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
resourceProviderServicesIEnumerable<IResourceProviderService>A list of IResourceProviderService resource providers hashed by resource provider name.
templatingServiceITemplatingServiceThe templating service used for replacing variables in prompts.
configurationIConfigurationThe IConfiguration used to retrieve app settings from configuration.
loggerILogger<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
instanceIdstringThe unique identifier of the FoundationaLLM instance.
agentNamestringThe 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
instanceIdstringThe unique identifier of the FoundationaLLM instance.
agentNamestringThe name of the agent.
agentSettingsAgentUserPromptRewriteSettingsThe 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
instanceIdstringThe unique identifier of the FoundationaLLM instance.
agentNamestringThe name of the agent.
completionRequestCompletionRequestThe CompletionRequest for which to rewrite the user prompt.
Returns
- Task
The rewritten user prompt.