Interface
IContextRetriever

Provides methods for retrieving relevant context from embeddings and managing text fragments.

Definition

Namespace:Telerik.Documents.AI.Core

Assembly:Telerik.Documents.AI.Core.dll

Syntax:

cs-api-definition
public interface IContextRetriever

Derived Classes: DefaultContextRetriever

Methods

GetContextAsync(string)

Gets the text representation of the relevant embeddings for the provided question.

Declaration

cs-api-definition
Task<string> GetContextAsync(string text)

Parameters

text

string

The user prompt to get relevant context for.

Returns

Task<string>

The text representations of the relevant embeddings.

SetContextAsync(string, int)

Asynchronously splits the specified text into fragments based on the provided embedding token size.

Declaration

cs-api-definition
Task SetContextAsync(string text, int embeddingTokenSize)

Parameters

text

string

The text to be divided into fragments. Cannot be null.

embeddingTokenSize

int

The maximum number of tokens allowed in each fragment. Must be a positive integer.

Returns

Task

A task that represents the asynchronous operation of fragmenting the text.