Partager via


AzureOpenAIServiceCollectionExtensions.AddAzureOpenAIChatCompletion Method

Definition

Overloads

AddAzureOpenAIChatCompletion(IServiceCollection, String, AzureOpenAIClient, String, String)

Adds the AzureOpenAIChatCompletionService to the IServiceCollection.

AddAzureOpenAIChatCompletion(IServiceCollection, String, String, TokenCredential, String, String)

Adds the AzureOpenAIChatCompletionService to the IServiceCollection.

AddAzureOpenAIChatCompletion(IServiceCollection, String, String, String, String, String)

Adds the AzureOpenAIChatCompletionService to the IServiceCollection.

AddAzureOpenAIChatCompletion(IServiceCollection, String, AzureOpenAIClient, String, String)

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureOpenAIChatCompletion (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string deploymentName, Azure.AI.OpenAI.AzureOpenAIClient? azureOpenAIClient = default, string? serviceId = default, string? modelId = default);
static member AddAzureOpenAIChatCompletion : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Azure.AI.OpenAI.AzureOpenAIClient * string * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAzureOpenAIChatCompletion (services As IServiceCollection, deploymentName As String, Optional azureOpenAIClient As AzureOpenAIClient = Nothing, Optional serviceId As String = Nothing, Optional modelId As String = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

The IServiceCollection instance to augment.

azureOpenAIClient
AzureOpenAIClient

AzureOpenAIClient to use for the service. If null, one must be available in the service provider when this service is resolved.

serviceId
String

A local identifier for the given AI service

Returns

The same instance as services.

Applies to

AddAzureOpenAIChatCompletion(IServiceCollection, String, String, TokenCredential, String, String)

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureOpenAIChatCompletion (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string deploymentName, string endpoint, Azure.Core.TokenCredential credentials, string? serviceId = default, string? modelId = default);
static member AddAzureOpenAIChatCompletion : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * Azure.Core.TokenCredential * string * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAzureOpenAIChatCompletion (services As IServiceCollection, deploymentName As String, endpoint As String, credentials As TokenCredential, Optional serviceId As String = Nothing, Optional modelId As String = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

The IServiceCollection instance to augment.

credentials
TokenCredential

Token credentials, e.g. DefaultAzureCredential, ManagedIdentityCredential, EnvironmentCredential, etc.

serviceId
String

A local identifier for the given AI service

Returns

The same instance as services.

Applies to

AddAzureOpenAIChatCompletion(IServiceCollection, String, String, String, String, String)

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureOpenAIChatCompletion (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string deploymentName, string endpoint, string apiKey, string? serviceId = default, string? modelId = default);
static member AddAzureOpenAIChatCompletion : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * string * string * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAzureOpenAIChatCompletion (services As IServiceCollection, deploymentName As String, endpoint As String, apiKey As String, Optional serviceId As String = Nothing, Optional modelId As String = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

The IServiceCollection instance to augment.

serviceId
String

A local identifier for the given AI service

Returns

The same instance as services.

Applies to