Class ConversationOptionalArgs
public sealed class ConversationOptionalArgs : LiteRTLMNativeHandle
- Inheritance
-
objectConversationOptionalArgs
- Inherited Members
Constructors
ConversationOptionalArgs()
Creates a managed wrapper around the optional arguments for conversation APIs. The caller is responsible for disposing the wrapper using Dispose().
public ConversationOptionalArgs()
Exceptions
- InvalidOperationException
Thrown if the native object could not be created.
Methods
ReleaseUnmanagedResources()
protected override void ReleaseUnmanagedResources()
SetConstraint(ConstraintType, string)
Sets the constraint for the conversation optional args.
public void SetConstraint(ConstraintType constraintType, string constraintString)
Parameters
constraintTypeConstraintTypeThe type of constraint.
constraintStringstringThe constraint pattern/schema/grammar string.
SetMaxOutputTokens(int)
Sets the maximum number of output tokens for the conversation optional arguments.
public void SetMaxOutputTokens(int maxOutputTokens)
Parameters
maxOutputTokensintThe maximum number of output tokens.
SetNoRepeatNgramConfig(NoRepeatNgramConfig?)
Sets the no repeat ngram configuration for the per-turn conversation optional arguments.
public void SetNoRepeatNgramConfig(NoRepeatNgramConfig? noRepeatNgramConfig)
Parameters
noRepeatNgramConfigNoRepeatNgramConfigThe no repeat ngram configuration. The contents are deep-copied when set. If null, clears any previously set no repeat ngram config so no repeat ngram banning applies.
Remarks
The configured parameters (no_repeat_ngram_size, window_size) apply
exclusively to the output sequence generated during the current
SendMessage(string, string?, ConversationOptionalArgs?) or SendMessageStream(StreamCallback, string, string?, ConversationOptionalArgs?) call.
SetRepetitionPenaltyConfig(RepetitionPenaltyConfig?)
Sets the repetition penalty configuration for the per-turn conversation optional arguments.
public void SetRepetitionPenaltyConfig(RepetitionPenaltyConfig? repetitionPenaltyConfig)
Parameters
repetitionPenaltyConfigRepetitionPenaltyConfigThe repetition penalty configuration. The contents are deep-copied when set. If null, clears any previously set repetition penalty config so no penalties apply.
Remarks
The configured penalties (repetition_penalty, presence_penalty,
frequency_penalty, window_size) apply exclusively to the output sequence
generated during the current SendMessage(string, string?, ConversationOptionalArgs?) or SendMessageStream(StreamCallback, string, string?, ConversationOptionalArgs?) call.
SetSuppressTokensConfig(SuppressTokensConfig?)
Sets the suppress tokens configuration for the per-turn conversation optional arguments.
public void SetSuppressTokensConfig(SuppressTokensConfig? suppressTokensConfig)
Parameters
suppressTokensConfigSuppressTokensConfigThe suppress tokens configuration. The contents are deep-copied when set. If null or if the inner token set is disabled/empty, clears any previously set suppress tokens config so no token suppression applies.
Remarks
The configured list of suppressed tokens applies exclusively to the output sequence generated during the current SendMessage(string, string?, ConversationOptionalArgs?) or SendMessageStream(StreamCallback, string, string?, ConversationOptionalArgs?) call.
SetThinkingConfig(ThinkingConfig?)
Sets the thinking config for the conversation optional args.
public void SetThinkingConfig(ThinkingConfig? thinkingConfig)
Parameters
thinkingConfigThinkingConfigThe thinking config to set. If null, clears any previously set thinking config.
SetVisualTokenBudget(int)
Sets the visual token budget for the conversation optional arguments.
public void SetVisualTokenBudget(int visualTokenBudget)
Parameters
visualTokenBudgetintThe visual token budget.