Table of Contents

Class VectorizationState

Namespace
FoundationaLLM.Vectorization.Models
Assembly
FoundationaLLM.Vectorization.Engine.dll

Holds the state associated with each step of the vectorization pipeline for a specified content item (i.e., document).

public class VectorizationState
Inheritance
VectorizationState
Inherited Members
Extension Methods

Fields

LoadedArtifactTypes

Indicates which types of artifacts have already been loaded into the state.

[JsonIgnore]
public List<VectorizationArtifactType> LoadedArtifactTypes

Field Value

List<VectorizationArtifactType>

Properties

Artifacts

The vectorization artifacts associated with the vectorization state.

[JsonPropertyOrder(2)]
[JsonPropertyName("artifacts")]
public List<VectorizationArtifact> Artifacts { get; set; }

Property Value

List<VectorizationArtifact>

ContentIdentifier

The ContentIdentifier object identifying the content being vectorized.

[JsonPropertyOrder(1)]
[JsonPropertyName("content_identifier")]
public required ContentIdentifier ContentIdentifier { get; set; }

Property Value

ContentIdentifier

CurrentRequestId

The unique identifier of the current vectorization request. Subsequent vectorization requests referring to the same content will have different unique identifiers.

[JsonPropertyOrder(0)]
[JsonPropertyName("request_id")]
public required string CurrentRequestId { get; set; }

Property Value

string

IndexReferences

The vector index references associated with the vectorization state.

[JsonPropertyOrder(3)]
[JsonPropertyName("index_references")]
public List<VectorizationIndexReference> IndexReferences { get; set; }

Property Value

List<VectorizationIndexReference>

LogEntries

The list of log entries associated with actions executed by the vectorization pipeline.

[JsonPropertyOrder(20)]
[JsonPropertyName("log")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<VectorizationLogEntry> LogEntries { get; set; }

Property Value

List<VectorizationLogEntry>

PipelineName

The resource name of the vectorization pipeline that generated the request.

[JsonPropertyOrder(17)]
[JsonPropertyName("pipeline_name")]
public string? PipelineName { get; set; }

Property Value

string

PipelineObjectId

The resource object id of the vectorization pipeline that generated the request.

[JsonPropertyOrder(18)]
[JsonPropertyName("pipeline_object_id")]
public string? PipelineObjectId { get; set; }

Property Value

string

Requests

The list of vectorization requests associated with the content identified by ContentIdentifier.

[JsonPropertyOrder(19)]
[JsonPropertyName("requests")]
public List<VectorizationRequest> Requests { get; set; }

Property Value

List<VectorizationRequest>

Methods

AddOrReplaceArtifact(VectorizationArtifact)

Adds or replaces a vectorization artifact associated with the vectorization state.

public void AddOrReplaceArtifact(VectorizationArtifact artifact)

Parameters

artifact VectorizationArtifact

The VectorizationArtifact to be added or replaced.

AddOrReplaceIndexReferences(IList<string>)

Adds or replaces the list of vector index references associated with the vectorization state.

public void AddOrReplaceIndexReferences(IList<string> indexEntryIds)

Parameters

indexEntryIds IList<string>

The ordered list of vector index entry identifiers.

FromRequest(VectorizationRequest)

Creates a new VectorizationState instance based on a specified vectorization request.

public static VectorizationState FromRequest(VectorizationRequest request)

Parameters

request VectorizationRequest

The VectorizationRequest instance for which the state is created.

Returns

VectorizationState

The VectorizationState created from the request.

Log(IVectorizationStepHandler, string, string, string)

Adds a new generic log entry.

public void Log(IVectorizationStepHandler handler, string requestId, string messageId, string text)

Parameters

handler IVectorizationStepHandler

The vectorization step handler executing the action.

requestId string

The identifier of the vectorization request.

messageId string

The identifier of underlying message retrieved from the request source.

text string

The string content of the log entry.

LogHandlerEnd(IVectorizationStepHandler, string, string)

Adds a log entry marking the completion of handling.

public void LogHandlerEnd(IVectorizationStepHandler handler, string requestId, string messageId)

Parameters

handler IVectorizationStepHandler

The vectorization step handler executing the action.

requestId string

The identifier of the vectorization request.

messageId string

The identifier of underlying message retrieved from the request source.

LogHandlerError(IVectorizationStepHandler, string, string, Exception)

Adds a log entry for a handling exception.

public void LogHandlerError(IVectorizationStepHandler handler, string requestId, string messageId, Exception ex)

Parameters

handler IVectorizationStepHandler

The vectorization step handler executing the action.

requestId string

The identifier of the vectorization request.

messageId string

The identifier of underlying message retrieved from the request source.

ex Exception

The exception being logged.

LogHandlerStart(IVectorizationStepHandler, string, string)

Adds a log entry marking the start of handling.

public void LogHandlerStart(IVectorizationStepHandler handler, string requestId, string messageId)

Parameters

handler IVectorizationStepHandler

The vectorization step handler executing the action.

requestId string

The identifier of the vectorization request.

messageId string

The identifier of underlying message retrieved from the request source.

UpdateRequest(VectorizationRequest)

Adds a vectorization request to the list of requests if it is not already there.

public void UpdateRequest(VectorizationRequest request)

Parameters

request VectorizationRequest

The VectorizationRequest being added.