Property PromptTemplate
PromptTemplate
Gets or sets the prompt template used when querying partitions.
public string PromptTemplate { get; set; }
Property Value
- string
The prompt template string. The default template is:
## Context:\n@context\n\n## Query:\n\n@query
Examples
var docRag = new DocumentRag(embeddingModel);
// Customize the prompt template with additional instructions
docRag.PromptTemplate =
"## Context:\n@context\n\n" +
"## Instructions:\nAnswer concisely based on the context above.\n\n" +
"## Query:\n@query";
Remarks
The template must contain the following placeholders (case-sensitive):
@context- Replaced with the concatenated content from matching partitions.@query- Replaced with the user's question.
Exceptions
- ArgumentException
Thrown when setting a
null, empty, or whitespace value.