Table of Contents

Property PromptTemplate

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

PromptTemplate

Gets or sets the prompt template used to inject retrieved context into the query.

public string PromptTemplate { get; set; }

Property Value

string

A template string containing @context and @query placeholders. Default is LMKit.Retrieval.RagPromptBuilder.DefaultPromptTemplate.

Examples

using var chat = new RagChat(ragEngine, chatModel);

// Use a custom prompt template
chat.PromptTemplate = "Use the following sources:\n@context\n\nQuestion: @query\n\nAnswer:";

Remarks

The @context placeholder is replaced with the concatenated payloads of the retrieved partitions, and @query with the user's question.

Share