CLlmClient::GetSystemPrompt Method  
 
INT GetSystemPrompt(
  LPTSTR lpszSystemPrompt,  
  INT nMaxLength  
);
INT GetSystemPrompt(
  CString &strSystemPrompt  
);

The GetSystemPrompt method returns the current system prompt for a client session.

Parameters

lpszSystemPrompt
A pointer to a string buffer which receives the system prompt for the current session. If this parameter is NULL, the method 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 method will fail. An alternate version of this method accepts a CString object which will contain the system prompt when the method returns.
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 method succeeds, the return value is the number of characters copied into the string buffer, not including the terminating null character. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The GetSystemPrompt method 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 method with a NULL buffer to determine the required length, then allocate a buffer of sufficient size and call the method again to retrieve the prompt.

If a system prompt has not been defined for the session, the method 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 ConnectEx and the LLM_SESSION structure, or modified at runtime using SetSystemPrompt.

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