Table of Contents

Class AgentTemplateService

Namespace
FoundationaLLM.Common.Services.ResourceProviders.Agent
Assembly
FoundationaLLM.Common.dll

Provides functionality for interacting with agent templates.

public class AgentTemplateService : IAgentTemplateService
Inheritance
AgentTemplateService
Implements
Inherited Members
Extension Methods

Constructors

AgentTemplateService(ILogger<AgentTemplateService>)

Initializes a new instance of the AgentTemplateService class.

public AgentTemplateService(ILogger<AgentTemplateService> logger)

Parameters

logger ILogger<AgentTemplateService>

The logger instance used for logging operations within the service.

Remarks

The constructor ensures that the service is fully initialized before any methods are called by waiting for the initialization task to complete and verifying the availability of required resource provider services.

Methods

CreateAgent(string, AgentCreationFromTemplateRequest, Dictionary<string, string>, UnifiedUserIdentity)

Creates a new agent based on the provided parameter values and template files.

public Task<ResourceProviderUpsertResult> CreateAgent(string instanceId, AgentCreationFromTemplateRequest createAgentRequest, Dictionary<string, string> rawAgentTemplateFiles, UnifiedUserIdentity userIdentity)

Parameters

instanceId string

The FoundationaLLM instance identifier.

createAgentRequest AgentCreationFromTemplateRequest

The request object containing the parameter values for creating the agent.

rawAgentTemplateFiles Dictionary<string, string>
userIdentity UnifiedUserIdentity

The identity of the user requesting to create the agent.

Returns

Task<ResourceProviderUpsertResult>

A task that represents the asynchronous operation. The task result contains a ResourceProviderUpsertResult indicating the outcome of the agent creation process.

Remarks

This method performs an asynchronous operation to create an agent based on the provided parameter values and template files. Ensure that all required template files are included in agentTemplateFiles and that the createAgentRequest contains valid parameters.

SetResourceProviderServices(IEnumerable<IResourceProviderService>)

Sets the collection of resource providers to be used by the service.

public void SetResourceProviderServices(IEnumerable<IResourceProviderService> resourceProviderServices)

Parameters

resourceProviderServices IEnumerable<IResourceProviderService>

A collection of resource provider services to register.

Remarks

Using this method is required to avoid circular references, since this service is a dependency for the FoundationaLLM.Agent resource provider while it also requires a refrence to the same resource provider.