Class TextOperationContext
- Namespace
- FoundationaLLM.Gateway.Models
- Assembly
- FoundationaLLM.Gateway.dll
Provides the context for a text operation.
public class TextOperationContext
- Inheritance
-
TextOperationContext
- Inherited Members
- Extension Methods
Fields
_syncRoot
protected readonly object _syncRoot
Field Value
Properties
InputTextChunks
The list of TextChunk objects which provide the input to the text operation.
public required IList<TextChunk> InputTextChunks { get; set; }
Property Value
IntermediateErrors
Gets or sets the list of intermediate error messages encountered during the text operation.
public List<string> IntermediateErrors { get; set; }
Property Value
ModelParameters
Gets or sets the model parameters.
public Dictionary<string, object> ModelParameters { get; set; }
Property Value
Prioritized
Indicates whether the requests associated with the context should be prioritized. Example: Synchronous vectorization and user prompt embedding for completions.
public bool Prioritized { get; set; }
Property Value
ProcessedTextChunksCount
Gets the count of processed text chunks based on the completeness checker function.
public int ProcessedTextChunksCount { get; }
Property Value
Result
The TextOperationResult holding the result of the text operation.
public required TextOperationResult Result { get; set; }
Property Value
TextChunkCompletenessChecker
The function used to check if a text chunk is complete.
public Func<TextChunk, bool> TextChunkCompletenessChecker { get; set; }
Property Value
TextChunkUpdater
The action used to update internal text chunks based on incoming text chunks.
public Action<TextChunk, TextChunk> TextChunkUpdater { get; set; }
Property Value
Methods
SetComplete()
Marks the text operation as complete.
public void SetComplete()
SetIntermediateError(string)
Sets a specified error message on the context of the text operation.
public void SetIntermediateError(string errorMessage)
Parameters
errorMessage
stringThe error message to be set.
UpdateTextChunks(IList<TextChunk>)
Updates the text chunks using the specified update and completeness check lambdas. If all positions are complete, marks the operation as complete.
public void UpdateTextChunks(IList<TextChunk> textChunks)