Table of Contents

Property MaxHistoryTurns

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

MaxHistoryTurns

Gets or sets the maximum number of recent conversation turns included when reformulating a follow-up question.

public int MaxHistoryTurns { get; set; }

Property Value

int

The maximum turn count. Default is 10.

Examples

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

// Use only the 3 most recent turns to reformulate follow-up questions.
chat.ContextualizationOptions.MaxHistoryTurns = 3;

Remarks

Each turn consists of one user message and one assistant response. Higher values provide richer context for resolving references in follow-up questions, at the cost of increased input tokens for the reformulation step.

Share