Class LakeraGuardService
- Namespace
- FoundationaLLM.Gatekeeper.Core.Services
- Assembly
- FoundationaLLM.Gatekeeper.Core.dll
Implements the ILakeraGuardService interface.
public class LakeraGuardService : ILakeraGuardService
- Inheritance
-
LakeraGuardService
- Implements
- Inherited Members
- Extension Methods
Constructors
LakeraGuardService(IOrchestrationContext, IHttpClientFactoryService, IOptions<LakeraGuardServiceSettings>, ILogger<LakeraGuardService>)
Constructor for the Azure Content Safety service.
public LakeraGuardService(IOrchestrationContext callContext, IHttpClientFactoryService httpClientFactoryService, IOptions<LakeraGuardServiceSettings> options, ILogger<LakeraGuardService> logger)
Parameters
callContext
IOrchestrationContextStores context information extracted from the current HTTP request. This information is primarily used to inject HTTP headers into downstream HTTP calls.
httpClientFactoryService
IHttpClientFactoryServiceThe HTTP client factory service.
options
IOptions<LakeraGuardServiceSettings>The configuration options for the Azure Content Safety service.
logger
ILogger<LakeraGuardService>The logger for the Azure Content Safety service.
Methods
DetectPromptInjection(string)
Detects attempted prompt injections and jailbreaks in user prompts.
public Task<string?> DetectPromptInjection(string content)
Parameters
content
stringThe text content that needs to be analyzed.