Class UserPromptRewriteService
- Namespace
- FoundationaLLM.Orchestration.Core.Services
- Assembly
- FoundationaLLM.Orchestration.Core.dll
Provides a service for managing the semantic cache.
public class UserPromptRewriteService : IUserPromptRewriteService
- Inheritance
-
UserPromptRewriteService
- Implements
- Inherited Members
- Extension Methods
Constructors
UserPromptRewriteService(IEnumerable<IResourceProviderService>, ITemplatingService, IConfiguration, ILogger<UserPromptRewriteService>)
Initializes a new instance of the UserPromptRewriteService class.
public UserPromptRewriteService(IEnumerable<IResourceProviderService> resourceProviderServices, ITemplatingService templatingService, IConfiguration configuration, ILogger<UserPromptRewriteService> logger)
Parameters
resourceProviderServices
IEnumerable<IResourceProviderService>A list of IResourceProviderService resource providers hashed by resource provider name.
templatingService
ITemplatingServiceThe templating service used for replacing variables in prompts.
configuration
IConfigurationThe IConfiguration used to retrieve app settings from configuration.
logger
ILogger<UserPromptRewriteService>The logger used for logging..
Methods
HasUserPromptRewriterForAgent(string, string)
Determines whether user prompt rewrite is configured for the specified agent in the specified FoundationaLLM instance.
public bool HasUserPromptRewriterForAgent(string instanceId, string agentName)
Parameters
instanceId
stringThe unique identifier of the FoundationaLLM instance.
agentName
stringThe name of the agent.
Returns
- bool
if the user prompt rewrite for the specified agent is configured, otherwise.
InitializeUserPromptRewriterForAgent(string, string, AgentUserPromptRewriteSettings)
Initializes user prompt rewrite for the specified agent in the specified FoundationaLLM instance.
public Task InitializeUserPromptRewriterForAgent(string instanceId, string agentName, AgentUserPromptRewriteSettings agentSettings)
Parameters
instanceId
stringThe unique identifier of the FoundationaLLM instance.
agentName
stringThe name of the agent.
agentSettings
AgentUserPromptRewriteSettingsThe AgentUserPromptRewriteSettings providing the agent's user prompt rewrite settings.
Returns
RewriteUserPrompt(string, string, CompletionRequest)
Rewrites the user prompt to a form that can be used by the AI model.
public Task RewriteUserPrompt(string instanceId, string agentName, CompletionRequest completionRequest)
Parameters
instanceId
stringThe unique identifier of the FoundationaLLM instance.
agentName
stringThe name of the agent.
completionRequest
CompletionRequestThe CompletionRequest for which to rewrite the user prompt.
Returns
- Task
The rewritten user prompt.