Table of Contents

Class SessionConfig

public sealed class SessionConfig : LiteRTLMNativeHandle
Inheritance
object
SessionConfig
Inherited Members

Constructors

SessionConfig()

Creates a managed wrapper around a LiteRT LM session configuration. The caller is responsible for disposing the wrapper using Dispose().

public SessionConfig()

Exceptions

InvalidOperationException

Thrown if the native object could not be created.

Methods

ReleaseUnmanagedResources()

protected override void ReleaseUnmanagedResources()

SetApplyPromptTemplate(bool)

Sets whether to apply the prompt template for this session.

public void SetApplyPromptTemplate(bool applyPromptTemplate)

Parameters

applyPromptTemplate bool

Whether to apply the prompt template.

SetAudioLoraPath(string)

Sets the path to the audio LoRA weights file.

public int SetAudioLoraPath(string audioLoraPath)

Parameters

audioLoraPath string

The path to the audio LoRA weights file.

Returns

int

0 on success, non-zero on failure.

SetLoraPath(string)

Sets the path to the LoRA weights file.

public int SetLoraPath(string loraPath)

Parameters

loraPath string

The path to the text LoRA weights file.

Returns

int

0 on success, non-zero on failure.

SetMaxOutputTokens(int)

Sets the maximum number of output tokens per decode step for this session.

public void SetMaxOutputTokens(int maxOutputTokens)

Parameters

maxOutputTokens int

The maximum number of output tokens.

SetSamplerParams(SamplerParams)

Sets the sampler parameters for this session configuration.

public void SetSamplerParams(SamplerParams samplerParams)

Parameters

samplerParams SamplerParams

The sampler parameters to use.