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
LMThe LM to use for this conversation.
contextSize
intOptionally 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
LMThe LM defining the language model.
chatHistory
ChatHistoryAn existing ChatHistory to continue from.
contextSize
intOptionally override the model's default context size. A value of -1 (default) lets the system pick an optimal size.
Exceptions
- ArgumentNullException
Thrown if
model
orchatHistory
is null.
MultiTurnConversation(LM, string)
Restores a previous conversation session from a file.
public MultiTurnConversation(LM model, string sessionFile)
Parameters
model
LMThe LM defining the language model.
sessionFile
stringThe 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
LMThe 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.