ClassPartialContextQuestionProcessor
Retrieval-augmented Q&A that indexes the document into embeddings and fetches the most similar chunks before prompting; use when the document exceeds the model’s input window.
Definition
Namespace:Telerik.Windows.Documents.AIConnector
Assembly:Telerik.Windows.Documents.AIConnector.dll
Syntax:
public sealed class PartialContextQuestionProcessor : AIProcessorBase, IDisposable
Inheritance: objectAIProcessorBasePartialContextQuestionProcessor
Implements:
Constructors
PartialContextQuestionProcessor(IChatClient, IContextRetriever, IEmbeddingSettings, SimpleTextDocument)
Initializes a new instance of the PartialContextQuestionProcessor class with the specified chat client, context retriever, context fragments manager, processor settings, and document.
Declaration
public PartialContextQuestionProcessor(IChatClient chatClient, IContextRetriever contextRetriever, IEmbeddingSettings settings, SimpleTextDocument document)
Parameters
chatClient
IChatClient
The chat client used to send and receive chat messages within the processing context.
contextRetriever
The context retriever responsible for obtaining relevant context information for question processing.
settings
The settings that configure the behavior of the partial context processor. Cannot be null.
document
The text document that provides the source content for context extraction and processing.
Exceptions
Thrown if the settings parameter is null.
PartialContextQuestionProcessor(IChatClient, IEmbedder, IEmbeddingSettings, SimpleTextDocument)
Initializes a new instance of the PartialContextQuestionProcessor class with the specified chat client, embedder, settings, and document.
Declaration
public PartialContextQuestionProcessor(IChatClient chatClient, IEmbedder embedder, IEmbeddingSettings settings, SimpleTextDocument document)
Parameters
chatClient
IChatClient
The chat client used to communicate with the AI model.
embedder
The embedder responsible for generating vector representations of text fragments for similarity calculations.
settings
The settings that configure partial context processing behavior, such as token limits and retrieval options.
document
The document containing the text to be processed for context retrieval. Cannot be null.
Exceptions
Thrown when the settings parameter is null.
Properties
Settings
Gets the settings that control retrieval-augmented behavior, including chunk size and the number of chunks sent.
Declaration
public IEmbeddingSettings Settings { get; }
Property Value
Methods
AnswerQuestion(string)
Generates an answer by retrieving the most relevant embedded chunks for the question and prompting the model.
Dispose()
Disposes the resources used by the PartialContextQuestionProcessor class.
Declaration
public override void Dispose()
Overrides
Implements