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
stringThe identifier of the vectorization step.
messageId
stringThe identifier of underlying message retrieved from the request source.
parameters
Dictionary<string, string>The dictionary of named parameters used to configure the handler.
stepsConfiguration
IConfigurationSectionThe app configuration section containing the configuration for vectorization pipeline steps.
stateService
IVectorizationStateServiceThe IVectorizationStateService that manages vectorization state.
serviceProvider
IServiceProviderThe IServiceProvider implemented by the dependency injection container.
loggerFactory
ILoggerFactoryThe logger factory used to create loggers for logging.
Fields
_logger
The logger used for logging.
protected readonly ILogger<VectorizationStepHandlerBase> _logger
Field Value
_messageId
The identifier of underlying message retrieved from the request source.
protected readonly string _messageId
Field Value
_parameters
The dictionary of named parameters used to configure the handler.
protected readonly Dictionary<string, string> _parameters
Field Value
_serviceProvider
The service provider implemented by the dependency injection container.
protected readonly IServiceProvider _serviceProvider
Field Value
_stateService
The vectorization state service.
protected readonly IVectorizationStateService _stateService
Field Value
_stepId
The identifier of the vectorization step.
protected readonly string _stepId
Field Value
_stepsConfiguration
The app configuration section containing the configuration for vectorization pipeline steps.
protected readonly IConfigurationSection? _stepsConfiguration
Field Value
Properties
StepId
The identifier of the vectorization pipeline step.
public string StepId { get; }
Property Value
Methods
Invoke(VectorizationRequest, VectorizationState, UnifiedUserIdentity, CancellationToken)
Invokes the handler.
public Task<bool> Invoke(VectorizationRequest request, VectorizationState state, UnifiedUserIdentity userIdentity, CancellationToken cancellationToken)
Parameters
request
VectorizationRequestThe VectorizationRequest for which the step should be handled.
state
VectorizationStateThe VectorizationState holding the state associated with the vectorization request.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity providing information about the calling user identity.
cancellationToken
CancellationTokenThe CancellationToken to monitor for cancellation requests.
Returns
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
VectorizationRequestThe VectorizationRequest to be processed.
state
VectorizationStateThe VectorizationState associated with the vectorization request.
stepConfiguration
IConfigurationSectionThe IConfigurationSection providing the configuration required by the step.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity providing information about the calling user identity.
cancellationToken
CancellationTokenThe CancellationToken that signals stopping the processing.