Class ConversationConfig
public sealed class ConversationConfig : LiteRTLMNativeHandle
- Inheritance
-
objectConversationConfig
- Inherited Members
Constructors
ConversationConfig()
Creates a managed wrapper around a LiteRT LM conversation configuration. The caller is responsible for disposing the wrapper using Dispose().
public ConversationConfig()
Exceptions
- InvalidOperationException
Thrown if the native object could not be created.
Methods
ReleaseUnmanagedResources()
protected override void ReleaseUnmanagedResources()
SetEnableConstrainedDecoding(bool)
Sets whether to enable constrained decoding for this conversation configuration.
public void SetEnableConstrainedDecoding(bool enableConstrainedDecoding)
Parameters
enableConstrainedDecodingboolWhether to enable constrained decoding.
SetExtraContext(string)
Sets the extra context for the conversation preface.
public void SetExtraContext(string extraContextJson)
Parameters
extraContextJsonstringA JSON string representing the extra context object.
SetFilterChannelContentFromKvCache(bool)
Sets whether to filter channel content from the KV cache.
public void SetFilterChannelContentFromKvCache(bool filterChannelContentFromKvCache)
Parameters
filterChannelContentFromKvCacheboolWhether to filter channel content.
SetMessages(string)
Sets the initial messages for this conversation configuration.
public void SetMessages(string messagesJson)
Parameters
messagesJsonstringThe initial messages in JSON array format.
SetSessionConfig(SessionConfig)
Sets the session config for this conversation configuration.
public void SetSessionConfig(SessionConfig sessionConfig)
Parameters
sessionConfigSessionConfigThe session config to use.
SetStreamToolCalls(bool, string)
Sets whether to stream tool call tokens.
public void SetStreamToolCalls(bool streamToolCalls, string channelName)
Parameters
streamToolCallsboolWhether to stream tool call tokens.
channelNamestringThe channel name to use for tool call tokens.
SetSystemMessage(string)
Sets the system message for this conversation configuration.
public void SetSystemMessage(string systemMessageJson)
Parameters
systemMessageJsonstringThe system message in JSON format.
SetThinkingConfig(ThinkingConfig?)
Sets the thinking config for this conversation config.
public void SetThinkingConfig(ThinkingConfig? thinkingConfig)
Parameters
thinkingConfigThinkingConfigThe thinking config to set. If null, clears any previously set thinking config.
SetTools(string)
Sets the tools for this conversation configuration.
public void SetTools(string toolsJson)
Parameters
toolsJsonstringThe tools description in JSON array format.