Telerik.Windows.Documents.AIConnector Abstract base for AI processors that run Q&A and summarization over document text (such as PDF), providing shared configuration and an IDisposable lifecycle for derived processors. Initializes a new instance of the class. The chat client to be used by the AI processor. Gets the chat client used by the AI processor. Releases resources held by the processor, including the underlying chat client. Calls the chat client with the specified system prompt and user message. The system prompt to be sent to the chat client. The user message to be sent to the chat client. A task that represents the asynchronous operation. The task result contains the response message text. Settings for full-context processing over document text (such as PDF), configuring token limits, encoding, and model selection. Gets the maximum input token limit for prompts sent to the model, bounding full-context requests. Gets the tokenization encoding used to measure and split text when preparing prompts. Gets the model identifier used for AI requests. Determines whether the context sent to the model is in JSON or plain text format, if json format is applicable. Plain text might consume more tokens but should lead to better results when asking the LLM. Initializes a new instance of the class with the specified maximum input token limit. The maximum input token limit for the model. The model identifier. The tokenization encoding the model uses. Determines whether the context sent to the model will be formatted as json when applicable. Provides factory methods for creating and configuring embedding settings used in processing text and spread documents with customizable model and tokenization parameters. Creates and configures settings for processing text documents with specified model and tokenization parameters. The maximum number of input tokens that the model can accept. Must be a positive integer. The identifier of the language model which will be used to process the question. If null, the default model is selected. The tokenization encoding scheme used by the model to apply to the text documents. If null, the default encoding is used. The maximum number of embeddings to include in the context. If null, no limit is applied. The size, in tokens, of each embedding. If null, the default size is used. An instance of configured with the specified parameters for text document processing. Creates settings configured for processing spread documents with partial context in JSON format. The maximum number of input tokens supported by the model which will answer the question. Must be a positive integer. The identifier of the model which will answer the question. If null, the default model is selected. The tokenization encoding scheme to apply when processing input text. If null, the default encoding is used. The size, in tokens, of each embedding chunk. If null, the default chunk size is applied. Specifies whether the context should be formatted as JSON. Set to to produce JSON-formatted context; otherwise, which will produce natural language. The total token limit for the context which will be sent to the answering model. If null, a percentage of the modelMaxInputTokenLimit will be used. An instance configured for spread document processing with the specified parameters. The name of the active sheet. Initializes a new instance of the DefaultContextRetriever class with the specified context fragments manager, embedder, similarity calculator, tokens counter, and embedding settings. The manager responsible for handling context fragments used in retrieval operations. Cannot be null. The component used to generate embeddings for context fragments. Cannot be null. The calculator used to determine similarity between embeddings. Cannot be null. The service used to count tokens in context fragments and embeddings. Cannot be null. The settings that configure embedding parameters, such as the maximum number of embeddings, embedding token size, and model input token limit. Cannot be null. Gets the text representation of the relevant embeddings for the provided question. The question text to find relevant context for. Cannot be null. The text representation of the relevant embeddings. Asynchronously splits the specified text into fragments based on the provided embedding token size. The text to be divided into fragments. Cannot be null. The maximum number of tokens allowed in each fragment. Must be a positive integer. A task that represents the asynchronous operation of fragmenting the text. Settings for retrieval-augmented (partial context) Q&A over document text (such as PDF), controlling chunking and how many results are sent. Gets how many retrieved chunks are included with the prompt when answering a question, controlling recall and cost. Gets the token length of each embedding chunk used during retrieval, affecting granularity and relevance. Settings for AI summarization over document text (such as PDF), configuring token limits and prompt customization. Gets optional prompt text appended to summarization requests, used for guidance or constraints. Initializes a new instance of the class. The maximum input token limit the model allows. An addition to the system prompt. The model identifier. The tokenization encoding the model uses. Single-shot Q&A that sends the entire document text to the model; use when the document fits within the model’s input token limit. Initializes a new instance of the class. The chat client to be used for communication with the AI model. The settings that configure full-context Q&A behavior. Gets the settings that configure full-context Q&A behavior, including token limits and encoding. Generates an answer by prompting the model with the entire document text and the question, up to the configured input token limit. The document. The question. The answer to the question. 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. Gets the settings that control retrieval-augmented behavior, including chunk size and the number of chunks sent. Initializes a new instance of the PartialContextQuestionProcessor class with the specified chat client, embedder, settings, and document. The chat client used to communicate with the AI model. The embedder responsible for generating vector representations of text fragments for similarity calculations. The settings that configure partial context processing behavior, such as token limits and retrieval options. The document containing the text to be processed for context retrieval. Cannot be null. Thrown when the settings parameter is null. Initializes a new instance of the PartialContextQuestionProcessor class with the specified chat client, context retriever, context fragments manager, processor settings, and document. The chat client used to send and receive chat messages within the processing context. The context retriever responsible for obtaining relevant context information for question processing. The settings that configure the behavior of the partial context processor. Cannot be null. The text document that provides the source content for context extraction and processing. Thrown if the settings parameter is null. Generates an answer by retrieving the most relevant embedded chunks for the question and prompting the model. The question to answer. A task that represents the asynchronous operation. The task result contains the answer to the question. Disposes the resources used by the class. Generates a concise summary of a document’s text (such as PDF) using full-context prompting up to the configured input token limit. Gets the settings that control summarization behavior, including token limits and prompt customization. Initializes a new instance of the class. The chat client used for communication with the AI service. The settings of the processor. Produces a summary of the provided document’s text (such as PDF) using full-context AI prompting, up to the configured input token limit. The document to be summarized. A task that represents the asynchronous operation. The task result contains the summarized text. Thrown when the summarization operation is cancelled. Raised when the number of tokens and calls required for summarization have been calculated; provides resource usage details and allows cancellation. Carries resource estimates for summarizing document text (such as PDF), including call count and token usage, and enables flow control. Creates event data with estimated calls and token counts for summarization over document text (such as PDF). The estimated number of calls required. The estimated number of tokens required. Gets the estimated number of model calls needed for summarization, impacting latency and cost. Gets the estimated input token count for summarization, bounded by the model’s input token limit. Gets or sets whether summarization should proceed based on the resource estimates.