CLlmClient::ValidateModel Method  
 
BOOL ValidateModel(
  LPCTSTR lpszModelName  
);

The ValidateModel method validates that a model name is recognized or supported by the current provider.

Parameters

lpszModelName
A null-terminated string which specifies the name of the model to validate. This parameter cannot be NULL or a zero-length string.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The ValidateModel method verifies that a model name appears to be valid for the current session. Validation may be performed using locally available information or by querying the provider for a list of supported models. If the provider supports returning model information, this method may perform a lookup to confirm that the specified model name is recognized. This may require a network request and can cause the method to block while the model list is retrieved.

If the provider does not support returning model information, the method only performs basic validation of the model name. For example, it will check the name to ensure it does not contain any illegal characters and uses a format that is common for most service providers. This method is most commonly used with applications to validate user input.

A successful return value from this method only indicates that the model name is syntactically valid. It does not guarantee that the selected service provider will accept or allow the model to be used. A provider may reject a valid model name for several reasons, including the model being unavailable for the current account, restricted to specific subscription tiers, region-limited, deprecated, disabled by administrative policy, or not supported by the endpoint being used. Providers may also change model availability over time without notice. Applications should be prepared to handle errors returned when establishing a session or sending a request, even if the model name was validated successfully.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csllmv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also