Class AzureAIContentSafetyClient
- Namespace
- FoundationaLLM.Common.Clients
- Assembly
- FoundationaLLM.Common.dll
Provides methods for interacting with Azure AI Content Safety services.
public class AzureAIContentSafetyClient : IAzureAIContentSafetyClient
- Inheritance
-
AzureAIContentSafetyClient
- Implements
- Inherited Members
- Extension Methods
Constructors
AzureAIContentSafetyClient(Uri, AzureKeyCredential, APIEndpointClientOptions?)
Initializes a new instance of the AzureAIContentSafetyClient class.
public AzureAIContentSafetyClient(Uri endpoint, AzureKeyCredential credential, APIEndpointClientOptions? options)
Parameters
endpoint
UriThe endpoint URI of the Azure AI Content Safety service.
credential
AzureKeyCredentialThe AzureKeyCredential used to authenticate requests to the service.
options
APIEndpointClientOptionsOptional configuration settings for the client, such as retry policies and timeouts.
Methods
AnalyzeText(AnalyzeTextRequest, CancellationToken)
public Task<ClientResult<AnalyzeTextResult>> AnalyzeText(AnalyzeTextRequest request, CancellationToken cancellationToken = default)
Parameters
request
AnalyzeTextRequestcancellationToken
CancellationToken
Returns
- Task<ClientResult<AnalyzeTextResult>>
BuildClient(Dictionary<string, object>)
Creates and configures a new instance of the AzureAIContentSafetyClient.
public static IAzureAIContentSafetyClient BuildClient(Dictionary<string, object> clientBuilderParameters)
Parameters
clientBuilderParameters
Dictionary<string, object>A dictionary of parameters used to further configure the client.
Returns
- IAzureAIContentSafetyClient
A new instance of the AzureAIContentSafetyClient configured with the specified
clientBuilderParameters
.
ShieldPrompt(ShieldPromptRequest, CancellationToken)
public Task<ClientResult<ShieldPromptResult>> ShieldPrompt(ShieldPromptRequest request, CancellationToken cancellationToken = default)
Parameters
request
ShieldPromptRequestcancellationToken
CancellationToken
Returns
- Task<ClientResult<ShieldPromptResult>>