Table of Contents

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 IAzureResourceManagerService

The 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 ILoggerFactory

The 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 string

The FoundationaLLM instance id.

capabilityCategory string

The category of the capability.

capabilityName string

The name of the capability to be created.

userIdentity UnifiedUserIdentity

The 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 CancellationToken

The CancellationToken signaling cancellation.

Returns

Task

GetEmbeddingOperationResult(string, string, UnifiedUserIdentity)

Retrieves the outcome of an embedding operation.

public Task<TextEmbeddingResult> GetEmbeddingOperationResult(string instanceId, string operationId, UnifiedUserIdentity userIdentity)

Parameters

instanceId string

The FoundationaLLM instance id.

operationId string

The unique identifier of the text embedding operation.

userIdentity UnifiedUserIdentity

The 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 CancellationToken

The CancellationToken signaling cancellation.

Returns

Task

StartEmbeddingOperation(string, TextEmbeddingRequest, UnifiedUserIdentity)

Starts an embedding operation.

public Task<TextEmbeddingResult> StartEmbeddingOperation(string instanceId, TextEmbeddingRequest embeddingRequest, UnifiedUserIdentity userIdentity)

Parameters

instanceId string

The FoundationaLLM instance id.

embeddingRequest TextEmbeddingRequest

The TextEmbeddingRequest object containing the details of the embedding operation.

userIdentity UnifiedUserIdentity

The 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 CancellationToken

The CancellationToken signaling cancellation.

Returns

Task