ClassEmbeddingSettingsFactory
Provides factory methods for creating and configuring embedding settings used in processing text and spread documents with customizable model and tokenization parameters.
Definition
Namespace:Telerik.Windows.Documents.AIConnector
Assembly:Telerik.Windows.Documents.AIConnector.dll
Syntax:
public static class EmbeddingSettingsFactory
Inheritance: objectEmbeddingSettingsFactory
Methods
CreateSettingsForSpreadDocuments(int, string, string, int?, bool, int?)
Creates settings configured for processing spread documents with partial context in JSON format.
Declaration
public static IEmbeddingSettings CreateSettingsForSpreadDocuments(int modelMaxInputTokenLimit, string modelId = null, string tokenizationEncoding = null, int? embeddingTokenSize = null, bool produceJsonFormattedContext = false, int? totalContextTokenLimit = null)
Parameters
modelMaxInputTokenLimit
The maximum number of input tokens supported by the model which will answer the question. Must be a positive integer.
modelId
The identifier of the model which will answer the question. If null, the default model is selected.
tokenizationEncoding
The tokenization encoding scheme to apply when processing input text. If null, the default encoding is used.
embeddingTokenSize
int?
The size, in tokens, of each embedding chunk. If null, the default chunk size is applied.
produceJsonFormattedContext
Specifies whether the context should be formatted as JSON. Set to true to produce JSON-formatted context; otherwise, false which will produce natural language.
totalContextTokenLimit
int?
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.
Returns
An IEmbeddingSettings instance configured for spread document processing with the specified parameters.
CreateSettingsForTextDocuments(int, string, string, int?, int?)
Creates and configures settings for processing text documents with specified model and tokenization parameters.
Declaration
public static IEmbeddingSettings CreateSettingsForTextDocuments(int modelMaxInputTokenLimit, string modelId = null, string tokenizationEncoding = null, int? maxNumberOfEmbeddingsIncludedInContext = null, int? embeddingTokenSize = null)
Parameters
modelMaxInputTokenLimit
The maximum number of input tokens that the model can accept. Must be a positive integer.
modelId
The identifier of the language model which will be used to process the question. If null, the default model is selected.
tokenizationEncoding
The tokenization encoding scheme used by the model to apply to the text documents. If null, the default encoding is used.
maxNumberOfEmbeddingsIncludedInContext
int?
The maximum number of embeddings to include in the context. If null, no limit is applied.
embeddingTokenSize
int?
The size, in tokens, of each embedding. If null, the default size is used.
Returns
An instance of IEmbeddingSettings configured with the specified parameters for text document processing.