Table of Contents

Constructor MultiTurnConversation

Namespace
LMKit.TextGeneration
Assembly
LM-Kit.NET.dll

MultiTurnConversation(LM, int)

Creates a new conversation instance, optionally specifying a contextSize.

public MultiTurnConversation(LM model, int contextSize = -1)

Parameters

model LM

The LM to use for this conversation.

contextSize int

Optionally override the model's default context size. A value of -1 (default) lets the system pick an optimal size based on available hardware.

Exceptions

ArgumentNullException

Thrown if model is null.

InvalidModelException

Thrown if the model is not suitable for conversation (embedding-only model, or missing weights).

MultiTurnConversation(LM, ChatHistory, int)

Creates a new conversation with a specified model and an existing ChatHistory.

public MultiTurnConversation(LM model, ChatHistory chatHistory, int contextSize = -1)

Parameters

model LM

The LM defining the language model.

chatHistory ChatHistory

An existing ChatHistory to continue from.

contextSize int

Optionally override the model's default context size. A value of -1 (default) lets the system pick an optimal size.

Exceptions

ArgumentNullException

Thrown if model or chatHistory is null.

MultiTurnConversation(LM, string)

Restores a previous conversation session from a file.

public MultiTurnConversation(LM model, string sessionFile)

Parameters

model LM

The LM defining the language model.

sessionFile string

The path to the session file created via SaveSession(string).

Exceptions

ArgumentNullException

Thrown if model is null.

InvalidModelException

Thrown if model is not suitable for multi-turn conversation.

MultiTurnConversation(LM, byte[])

Restores a previous conversation session from a byte array.

public MultiTurnConversation(LM model, byte[] sessionData)

Parameters

model LM

The LM defining the language model.

sessionData byte[]

The session data created via SaveSession().

Exceptions

ArgumentNullException

Thrown if model is null.

InvalidModelException

Thrown if model is not suitable for multi-turn conversation.