Interface ISemanticCacheService
- Namespace
- FoundationaLLM.Orchestration.Core.Interfaces
- Assembly
- FoundationaLLM.Orchestration.Core.dll
Defines the interface for the semantic cache service.
public interface ISemanticCacheService- Extension Methods
Methods
GetCompletionResponseFromCache(string, string, CompletionRequest)
Tries to get a CompletionResponse from the semantic cache for the specified agent in the specified FoundationaLLM instance.
Task<CompletionResponse?> GetCompletionResponseFromCache(string instanceId, string agentName, CompletionRequest completionRequest)Parameters
- instanceIdstring
- The unique identifier of the FoundationaLLM instance. 
- agentNamestring
- The name of the agent. 
- completionRequestCompletionRequest
- The CompletionRequest for which to get the cache item. 
Returns
- Task<CompletionResponse>
- A CompletionResponse if a match exists. 
HasCacheForAgent(string, string)
Determines whether the semantic cache for the specified agent in the specified FoundationaLLM instance exists.
bool HasCacheForAgent(string instanceId, string agentName)Parameters
- instanceIdstring
- The unique identifier of the FoundationaLLM instance. 
- agentNamestring
- The name of the agent. 
Returns
- bool
- if the semantic cache for the specified agent exists, - otherwise. 
InitializeCacheForAgent(string, string, AgentSemanticCacheSettings)
Initializes the semantic cache for the specified agent in the specified FoundationaLLM instance.
Task InitializeCacheForAgent(string instanceId, string agentName, AgentSemanticCacheSettings agentSettings)Parameters
- instanceIdstring
- The unique identifier of the FoundationaLLM instance. 
- agentNamestring
- The name of the agent. 
- agentSettingsAgentSemanticCacheSettings
- The AgentSemanticCacheSettings providing the agent's semantic cache settings. 
Returns
ResetCacheForAgent(string, string)
Resets the semantic cache for the specified agent in the specified FoundationaLLM instance.
Task ResetCacheForAgent(string instanceId, string agentName)Parameters
- instanceIdstring
- The unique identifier of the FoundationaLLM instance. 
- agentNamestring
- The name of the agent. 
Returns
SetCompletionResponseInCache(string, string, CompletionResponse)
Sets a CompletionResponse in the semantic cache for the specified agent in the specified FoundationaLLM instance.
Task SetCompletionResponseInCache(string instanceId, string agentName, CompletionResponse completionResponse)Parameters
- instanceIdstring
- The unique identifier of the FoundationaLLM instance. 
- agentNamestring
- The name of the agent. 
- completionResponseCompletionResponse
- The CompletionResponse to be set in the agent's cache.