Constructor RagChat
RagChat(RagEngine, LM, int)
Initializes a new instance of the RagChat class.
public RagChat(RagEngine ragEngine, LM chatModel, int contextSize = -1)
Parameters
ragEngineRagEngineThe RAG engine used for retrieval. The caller retains ownership; the engine is not disposed when this instance is disposed.
chatModelLMThe language model for generating responses.
contextSizeintToken context size override, or
-1to let the runtime select an optimal size based on hardware and model configuration.
Examples
var ragEngine = new RagEngine(embeddingModel);
ragEngine.ImportText("LM-Kit supports local LLM inference.");
using var chat = new RagChat(ragEngine, chatModel);
var result = await chat.SubmitAsync("What does LM-Kit support?");
Exceptions
- ArgumentNullException
Thrown if
ragEngineorchatModelisnull.