LlmGetModelName Function  
 
INT WINAPI LlmGetModelName(
  HCLIENT hClient,  
  LPTSTR lpszModelName,  
  INT nMaxLength  
);

The LlmGetModelName function returns the name of the current model for the client session.

Parameters

hClient
A handle to the client session.
lpszModelName
A pointer to a string buffer which will contain the name of the current model when the function returns. This parameter cannot be NULL and must be large enough to contain the complete model name, including the terminating null character. If the buffer is not large enough to contain the entire name, the function will fail.
nMaxLength
An integer value which specifies the maximum number of characters which can be copied into the string buffer, including the terminating null character. This parameter cannot be zero and the function will fail if an invalid size is provided by the caller.

Return Value

If the function succeeds, the return value is the number of characters copied into the string buffer, not including the terminating null character. If the function fails, the return value is zero. To get extended error information, call LlmGetLastError.

Remarks

The LlmGetModelName function returns the model name currently associated with the client session. This is the model that will be used for subsequent requests unless it is changed by calling LlmSetModelName. The model name is stored as part of the session state and does not require the client session to be disconnected and reconnected.

The returned model name may have been specified when the session was created, selected automatically from the provider defaults, or changed by a previous call to LlmSetModelName. If no valid model name is currently associated with the session, the function will fail.

Changing the model name only affects subsequent requests. It does not modify any messages or responses already stored in the client history, and it does not validate that the model exists or is available from the current provider. To enumerate or validate model names, use functions such as LlmEnumModels, LlmGetModelInfo, or LlmValidateModel.

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, LlmGetModelContextSize, LlmGetModelFlags, LlmGetModelInfo, LlmSetModelName