Class OrchestrationBuilder
- Namespace
- FoundationaLLM.Orchestration.Core.Orchestration
- Assembly
- FoundationaLLM.Orchestration.Core.dll
Builds an orchestration for a FoundationaLLM agent.
public class OrchestrationBuilder
- Inheritance
-
OrchestrationBuilder
- Inherited Members
- Extension Methods
Methods
Build(string, string, CompletionRequest, IOrchestrationContext, IConfiguration, Dictionary<string, IResourceProviderService>, ILLMOrchestrationServiceManager, IAzureCosmosDBService, ITemplatingService, IContextServiceClient, IUserPromptRewriteService, ISemanticCacheService, IServiceProvider, ILoggerFactory, Func<LLMCompletionRequest, Task>?)
Builds the orchestration used to handle a synchronous completion operation or start an asynchronous completion operation.
public static Task<OrchestrationBase?> Build(string instanceId, string agentName, CompletionRequest originalRequest, IOrchestrationContext callContext, IConfiguration configuration, Dictionary<string, IResourceProviderService> resourceProviderServices, ILLMOrchestrationServiceManager llmOrchestrationServiceManager, IAzureCosmosDBService cosmosDBService, ITemplatingService templatingService, IContextServiceClient contextServiceClient, IUserPromptRewriteService userPromptRewriteService, ISemanticCacheService semanticCacheService, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, Func<LLMCompletionRequest, Task>? completionRequestObserver = null)
Parameters
instanceId
stringThe FoundationaLLM instance ID.
agentName
stringThe unique name of the agent for which the orchestration is built.
originalRequest
CompletionRequestThe CompletionRequest request for which the orchestration is built.
callContext
IOrchestrationContextThe call context of the request being handled.
configuration
IConfigurationThe IConfiguration used to retrieve app settings from configuration.
resourceProviderServices
Dictionary<string, IResourceProviderService>A dictionary of IResourceProviderService resource providers hashed by resource provider name.
llmOrchestrationServiceManager
ILLMOrchestrationServiceManagerThe ILLMOrchestrationServiceManager that manages internal and external orchestration services.
cosmosDBService
IAzureCosmosDBServiceThe IAzureCosmosDBService used to interact with the Cosmos DB database.
templatingService
ITemplatingServiceThe ITemplatingService used to render templates.
contextServiceClient
IContextServiceClientThe IContextServiceClient client used to call the Context API.
userPromptRewriteService
IUserPromptRewriteServiceThe IUserPromptRewriteService used to rewrite user prompts.
semanticCacheService
ISemanticCacheServiceThe ISemanticCacheService used to cache and retrieve completion responses.
serviceProvider
IServiceProviderThe IServiceProvider provding dependency injection services for the current scope.
loggerFactory
ILoggerFactoryThe logger factory used to create new loggers.
completionRequestObserver
Func<LLMCompletionRequest, Task>An optional observer for completion requests.
Returns
Exceptions
BuildForStatus(string, string, IOrchestrationContext, IConfiguration, Dictionary<string, IResourceProviderService>, ILLMOrchestrationServiceManager, IAzureCosmosDBService, ISemanticCacheService, IServiceProvider, ILoggerFactory)
Builds the orchestration used to retrieve the status of an asynchronous completion operation.
public static Task<OrchestrationBase?> BuildForStatus(string instanceId, string operationId, IOrchestrationContext callContext, IConfiguration configuration, Dictionary<string, IResourceProviderService> resourceProviderServices, ILLMOrchestrationServiceManager llmOrchestrationServiceManager, IAzureCosmosDBService cosmosDBService, ISemanticCacheService semanticCacheService, IServiceProvider serviceProvider, ILoggerFactory loggerFactory)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
operationId
stringThe asynchronous completion operation identifier.
callContext
IOrchestrationContextThe call context of the request being handled.
configuration
IConfigurationThe IConfiguration used to retrieve app settings from configuration.
resourceProviderServices
Dictionary<string, IResourceProviderService>A dictionary of IResourceProviderService resource providers hashed by resource provider name.
llmOrchestrationServiceManager
ILLMOrchestrationServiceManagerThe ILLMOrchestrationServiceManager that manages internal and external orchestration services.
cosmosDBService
IAzureCosmosDBServiceThe IAzureCosmosDBService used to interact with the Cosmos DB database.
semanticCacheService
ISemanticCacheServiceThe ISemanticCacheService used to cache and retrieve completion responses.
serviceProvider
IServiceProviderThe IServiceProvider provding dependency injection services for the current scope.
loggerFactory
ILoggerFactoryThe logger factory used to create new loggers.