Table of Contents

Constructor RagChat

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

RagChat(RagEngine, LM, int)

Initializes a new instance of the RagChat class.

public RagChat(RagEngine ragEngine, LM chatModel, int contextSize = -1)

Parameters

ragEngine RagEngine

The RAG engine used for retrieval. The caller retains ownership; the engine is not disposed when this instance is disposed.

chatModel LM

The language model for generating responses.

contextSize int

Token context size override, or -1 to 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 ragEngine or chatModel is null.

Share