Table of Contents

Class VectorizationStepHandlerBase

Namespace
FoundationaLLM.Vectorization.Handlers
Assembly
FoundationaLLM.Vectorization.Engine.dll

Implements basic vectorization step handler functionality.

public class VectorizationStepHandlerBase : IVectorizationStepHandler
Inheritance
VectorizationStepHandlerBase
Implements
Derived
Inherited Members
Extension Methods

Constructors

VectorizationStepHandlerBase(string, string, Dictionary<string, string>, IConfigurationSection?, IVectorizationStateService, IServiceProvider, ILoggerFactory)

Implements basic vectorization step handler functionality.

public VectorizationStepHandlerBase(string stepId, string messageId, Dictionary<string, string> parameters, IConfigurationSection? stepsConfiguration, IVectorizationStateService stateService, IServiceProvider serviceProvider, ILoggerFactory loggerFactory)

Parameters

stepId string

The identifier of the vectorization step.

messageId string

The identifier of underlying message retrieved from the request source.

parameters Dictionary<string, string>

The dictionary of named parameters used to configure the handler.

stepsConfiguration IConfigurationSection

The app configuration section containing the configuration for vectorization pipeline steps.

stateService IVectorizationStateService

The IVectorizationStateService that manages vectorization state.

serviceProvider IServiceProvider

The IServiceProvider implemented by the dependency injection container.

loggerFactory ILoggerFactory

The logger factory used to create loggers for logging.

Fields

_logger

The logger used for logging.

protected readonly ILogger<VectorizationStepHandlerBase> _logger

Field Value

ILogger<VectorizationStepHandlerBase>

_messageId

The identifier of underlying message retrieved from the request source.

protected readonly string _messageId

Field Value

string

_parameters

The dictionary of named parameters used to configure the handler.

protected readonly Dictionary<string, string> _parameters

Field Value

Dictionary<string, string>

_serviceProvider

The service provider implemented by the dependency injection container.

protected readonly IServiceProvider _serviceProvider

Field Value

IServiceProvider

_stateService

The vectorization state service.

protected readonly IVectorizationStateService _stateService

Field Value

IVectorizationStateService

_stepId

The identifier of the vectorization step.

protected readonly string _stepId

Field Value

string

_stepsConfiguration

The app configuration section containing the configuration for vectorization pipeline steps.

protected readonly IConfigurationSection? _stepsConfiguration

Field Value

IConfigurationSection

Properties

StepId

The identifier of the vectorization pipeline step.

public string StepId { get; }

Property Value

string

Methods

Invoke(VectorizationRequest, VectorizationState, UnifiedUserIdentity, CancellationToken)

Invokes the handler.

public Task<bool> Invoke(VectorizationRequest request, VectorizationState state, UnifiedUserIdentity userIdentity, CancellationToken cancellationToken)

Parameters

request VectorizationRequest

The VectorizationRequest for which the step should be handled.

state VectorizationState

The VectorizationState holding the state associated with the vectorization request.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity providing information about the calling user identity.

cancellationToken CancellationToken

The CancellationToken to monitor for cancellation requests.

Returns

Task<bool>

True if the vectorization step request was handled successfully.

ProcessRequest(VectorizationRequest, VectorizationState, IConfigurationSection?, UnifiedUserIdentity, CancellationToken)

Processes a vectorization request. The vectorization state will be updated with the result(s) of the processing.

protected virtual Task<bool> ProcessRequest(VectorizationRequest request, VectorizationState state, IConfigurationSection? stepConfiguration, UnifiedUserIdentity userIdentity, CancellationToken cancellationToken)

Parameters

request VectorizationRequest

The VectorizationRequest to be processed.

state VectorizationState

The VectorizationState associated with the vectorization request.

stepConfiguration IConfigurationSection

The IConfigurationSection providing the configuration required by the step.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity providing information about the calling user identity.

cancellationToken CancellationToken

The CancellationToken that signals stopping the processing.

Returns

Task<bool>