LlmGetSystemPrompt Function  
 
INT WINAPI LlmGetSystemPrompt(
  HCLIENT hClient,  
  LPTSTR lpszSystemPrompt,  
  INT nMaxLength  
);

The LlmGetSystemPrompt function returns the current system prompt for a client session.

Parameters

hClient
A handle to the client session.
lpszSystemPrompt
A pointer to a string buffer which receives the system prompt for the current session. If this parameter is NULL, the function returns the length of the system prompt without copying any characters. If a buffer is provided, it must be large enough to contain the entire prompt, including the terminating null character, or 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. If the lpszSystemPrompt parameter is NULL, this value should be zero.

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 LlmGetSystemPrompt function retrieves the system prompt associated with the specified client session. The system prompt provides initial instructions to the model and influences how responses are generated for subsequent requests.

To retrieve the system prompt, an application can first call this function with a NULL buffer to determine the required length, then allocate a buffer of sufficient size and call the function again to retrieve the prompt.

If a system prompt has not been defined for the session, the function returns zero and the last error code is set to NO_ERROR. This condition indicates that no prompt is currently set and should not be treated as a failure.

The system prompt may be specified when creating a session using LlmConnectEx and the LLM_SESSION structure, or modified at runtime using LlmSetSystemPrompt.

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

LlmConnectEx, LlmCreateSessionEx, LlmSetSystemPrompt, LLM_SESSION