LlmValidateModel Function  
 
BOOL WINAPI LlmValidateModel(
  HCLIENT hClient,  
  LPCTSTR lpszModelName  
);

The LlmValidateModel function validates that a model name is recognized or supported by the current provider.

Parameters

hClient
A handle to the client session.
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 function succeeds, the return value is non-zero. If the function fails, the return value is zero. To get extended error information, call LlmGetLastError.

Remarks

The LlmValidateModel function 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 function may perform a lookup to confirm that the specified model name is recognized. This may require a network request and can cause the function to block while the model list is retrieved.

If the provider does not support returning model information, the function 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 function is most commonly used with applications to validate user input.

A successful return value from this function 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

LlmEnumModels, LlmGetModelInfo, LlmSetModelFlags, LlmSetModelName