Table of Contents

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 string

The FoundationaLLM instance ID.

agentName string

The unique name of the agent for which the orchestration is built.

originalRequest CompletionRequest

The CompletionRequest request for which the orchestration is built.

callContext IOrchestrationContext

The call context of the request being handled.

configuration IConfiguration

The IConfiguration used to retrieve app settings from configuration.

resourceProviderServices Dictionary<string, IResourceProviderService>

A dictionary of IResourceProviderService resource providers hashed by resource provider name.

llmOrchestrationServiceManager ILLMOrchestrationServiceManager

The ILLMOrchestrationServiceManager that manages internal and external orchestration services.

cosmosDBService IAzureCosmosDBService

The IAzureCosmosDBService used to interact with the Cosmos DB database.

templatingService ITemplatingService

The ITemplatingService used to render templates.

contextServiceClient IContextServiceClient

The IContextServiceClient client used to call the Context API.

userPromptRewriteService IUserPromptRewriteService

The IUserPromptRewriteService used to rewrite user prompts.

semanticCacheService ISemanticCacheService

The ISemanticCacheService used to cache and retrieve completion responses.

serviceProvider IServiceProvider

The IServiceProvider provding dependency injection services for the current scope.

loggerFactory ILoggerFactory

The logger factory used to create new loggers.

completionRequestObserver Func<LLMCompletionRequest, Task>

An optional observer for completion requests.

Returns

Task<OrchestrationBase>

Exceptions

ArgumentException

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 string

The FoundationaLLM instance identifier.

operationId string

The asynchronous completion operation identifier.

callContext IOrchestrationContext

The call context of the request being handled.

configuration IConfiguration

The IConfiguration used to retrieve app settings from configuration.

resourceProviderServices Dictionary<string, IResourceProviderService>

A dictionary of IResourceProviderService resource providers hashed by resource provider name.

llmOrchestrationServiceManager ILLMOrchestrationServiceManager

The ILLMOrchestrationServiceManager that manages internal and external orchestration services.

cosmosDBService IAzureCosmosDBService

The IAzureCosmosDBService used to interact with the Cosmos DB database.

semanticCacheService ISemanticCacheService

The ISemanticCacheService used to cache and retrieve completion responses.

serviceProvider IServiceProvider

The IServiceProvider provding dependency injection services for the current scope.

loggerFactory ILoggerFactory

The logger factory used to create new loggers.

Returns

Task<OrchestrationBase>

Exceptions

ArgumentException