Table of Contents

Class ConversationConfig

public sealed class ConversationConfig : LiteRTLMNativeHandle
Inheritance
object
ConversationConfig
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

enableConstrainedDecoding bool

Whether to enable constrained decoding.

SetExtraContext(string)

Sets the extra context for the conversation preface.

public void SetExtraContext(string extraContextJson)

Parameters

extraContextJson string

A 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

filterChannelContentFromKvCache bool

Whether to filter channel content.

SetMessages(string)

Sets the initial messages for this conversation configuration.

public void SetMessages(string messagesJson)

Parameters

messagesJson string

The initial messages in JSON array format.

SetSessionConfig(SessionConfig)

Sets the session config for this conversation configuration.

public void SetSessionConfig(SessionConfig sessionConfig)

Parameters

sessionConfig SessionConfig

The session config to use.

SetStreamToolCalls(bool, string)

Sets whether to stream tool call tokens.

public void SetStreamToolCalls(bool streamToolCalls, string channelName)

Parameters

streamToolCalls bool

Whether to stream tool call tokens.

channelName string

The channel name to use for tool call tokens.

SetSystemMessage(string)

Sets the system message for this conversation configuration.

public void SetSystemMessage(string systemMessageJson)

Parameters

systemMessageJson string

The system message in JSON format.

SetThinkingConfig(ThinkingConfig?)

Sets the thinking config for this conversation config.

public void SetThinkingConfig(ThinkingConfig? thinkingConfig)

Parameters

thinkingConfig ThinkingConfig

The 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

toolsJson string

The tools description in JSON array format.