Table of Contents

Property MaxCompletionTokens

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

MaxCompletionTokens

Gets or sets the maximum number of tokens allocated for the hypothetical answer generation step.

public int MaxCompletionTokens { get; set; }

Property Value

int

The maximum token count. Default is 512.

Examples

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

// Allow longer hypothetical answers for complex technical topics.
chat.HydeOptions.MaxCompletionTokens = 1024;

RagQueryResult result = chat.Submit("How does tokenization work?");
Console.WriteLine(result.Response.Completion);

Remarks

This controls the output length of the generation step. The hypothetical answer is a short passage rather than a single sentence, so the default budget is higher than for query variant generation.

Share