Class GatewayCore
- Namespace
- FoundationaLLM.Gateway.Services
- Assembly
- FoundationaLLM.Gateway.dll
Implements the FoundationaLLM Gateway service.
public class GatewayCore : IGatewayCore
- Inheritance
-
GatewayCore
- Implements
- Inherited Members
- Extension Methods
Constructors
GatewayCore(IAzureResourceManagerService, IOptions<GatewayCoreSettings>, IEnumerable<IResourceProviderService>, ILoggerFactory)
Implements the FoundationaLLM Gateway service.
public GatewayCore(IAzureResourceManagerService armService, IOptions<GatewayCoreSettings> options, IEnumerable<IResourceProviderService> resourceProviderServices, ILoggerFactory loggerFactory)
Parameters
armService
IAzureResourceManagerServiceThe IAzureResourceManagerService instance providing Azure Resource Manager services.
options
IOptions<GatewayCoreSettings>The options providing the GatewayCoreSettings object.
resourceProviderServices
IEnumerable<IResourceProviderService>A dictionary of IResourceProviderService resource providers hashed by resource provider name.
loggerFactory
ILoggerFactoryThe ILoggerFactory used to create loggers for logging.
Methods
CreateAgentCapability(string, string, string, UnifiedUserIdentity, Dictionary<string, object>?)
Creates a new LLM-based agent capability.
public Task<Dictionary<string, object>> CreateAgentCapability(string instanceId, string capabilityCategory, string capabilityName, UnifiedUserIdentity userIdentity, Dictionary<string, object>? parameters = null)
Parameters
instanceId
stringThe FoundationaLLM instance id.
capabilityCategory
stringThe category of the capability.
capabilityName
stringThe name of the capability to be created.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity providing information about the calling user identity.
parameters
Dictionary<string, object>A dictionary of parameter values used to create the capability.
Returns
- Task<Dictionary<string, object>>
A dictionary of output values.
Remarks
The supported categories are:
- OpenAI.Assistants (the names of the keys for the parameters and output dictionaries are defined in OpenAIAgentCapabilityParameterNames)
ExecuteAsync(CancellationToken)
Executes the Gateway service until cancellation is signaled.
public Task ExecuteAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenThe CancellationToken signaling cancellation.
Returns
GetEmbeddingOperationResult(string, string, UnifiedUserIdentity)
Retrieves the outcome of an embedding operation.
public Task<TextEmbeddingResult> GetEmbeddingOperationResult(string instanceId, string operationId, UnifiedUserIdentity userIdentity)
Parameters
instanceId
stringThe FoundationaLLM instance id.
operationId
stringThe unique identifier of the text embedding operation.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity providing information about the calling user identity.
Returns
- Task<TextEmbeddingResult>
A TextEmbeddingResult object with the outcome of the operation.
StartAsync(CancellationToken)
Starts the Gateway service, allowing it to initialize.
public Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenThe CancellationToken signaling cancellation.
Returns
StartEmbeddingOperation(string, TextEmbeddingRequest, UnifiedUserIdentity)
Starts an embedding operation.
public Task<TextEmbeddingResult> StartEmbeddingOperation(string instanceId, TextEmbeddingRequest embeddingRequest, UnifiedUserIdentity userIdentity)
Parameters
instanceId
stringThe FoundationaLLM instance id.
embeddingRequest
TextEmbeddingRequestThe TextEmbeddingRequest object containing the details of the embedding operation.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity providing information about the calling user identity.
Returns
- Task<TextEmbeddingResult>
A TextEmbeddingResult object with the outcome of the operation.
StopAsync(CancellationToken)
Stops the Gateway service, allowing it to cleanup.
public Task StopAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenThe CancellationToken signaling cancellation.