AzureAIInferenceServiceCollectionExtensions.AddAzureAIInferenceChatCompletion Method

Definition

Overloads

AddAzureAIInferenceChatCompletion(IServiceCollection, AzureAIInferenceChatClient, String)

Adds an Azure AI Inference IChatCompletionService to the IServiceCollection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureAIInferenceChatCompletion(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.AI.AzureAIInferenceChatClient? chatClient = default, string? serviceId = default);
static member AddAzureAIInferenceChatCompletion : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.AI.AzureAIInferenceChatClient * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAzureAIInferenceChatCompletion (services As IServiceCollection, Optional chatClient As AzureAIInferenceChatClient = Nothing, Optional serviceId As String = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

The IServiceCollection instance to augment.

chatClient
AzureAIInferenceChatClient

AzureAIInferenceChatClient 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

AddAzureAIInferenceChatCompletion(IServiceCollection, String, ChatCompletionsClient, String)

Adds an Azure AI Inference IChatCompletionService to the IServiceCollection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureAIInferenceChatCompletion(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string modelId, Azure.AI.Inference.ChatCompletionsClient? chatClient = default, string? serviceId = default);
static member AddAzureAIInferenceChatCompletion : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Azure.AI.Inference.ChatCompletionsClient * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAzureAIInferenceChatCompletion (services As IServiceCollection, modelId As String, Optional chatClient As ChatCompletionsClient = Nothing, Optional serviceId As String = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

The IServiceCollection instance to augment.

modelId
String

Azure AI Inference model id

chatClient
ChatCompletionsClient

ChatCompletionsClient 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

AddAzureAIInferenceChatCompletion(IServiceCollection, String, TokenCredential, Uri, HttpClient, String)

Adds an Azure AI Inference IChatCompletionService to the IServiceCollection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureAIInferenceChatCompletion(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string modelId, Azure.Core.TokenCredential credential, Uri? endpoint = default, System.Net.Http.HttpClient? httpClient = default, string? serviceId = default);
static member AddAzureAIInferenceChatCompletion : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Azure.Core.TokenCredential * Uri * System.Net.Http.HttpClient * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAzureAIInferenceChatCompletion (services As IServiceCollection, modelId As String, credential As TokenCredential, Optional endpoint As Uri = Nothing, Optional httpClient As HttpClient = Nothing, Optional serviceId As String = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

The IServiceCollection instance to augment.

modelId
String

Target Model Id

credential
TokenCredential

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

endpoint
Uri

Endpoint / Target URI

httpClient
HttpClient

Custom HttpClient for HTTP requests.

serviceId
String

A local identifier for the given AI service

Returns

The same instance as services.

Applies to

AddAzureAIInferenceChatCompletion(IServiceCollection, String, String, Uri, HttpClient, String)

Adds an Azure AI Inference IChatCompletionService to the IServiceCollection.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureAIInferenceChatCompletion(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string modelId, string? apiKey = default, Uri? endpoint = default, System.Net.Http.HttpClient? httpClient = default, string? serviceId = default);
static member AddAzureAIInferenceChatCompletion : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * Uri * System.Net.Http.HttpClient * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAzureAIInferenceChatCompletion (services As IServiceCollection, modelId As String, Optional apiKey As String = Nothing, Optional endpoint As Uri = Nothing, Optional httpClient As HttpClient = Nothing, Optional serviceId As String = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

The IServiceCollection instance to augment.

modelId
String

Target Model Id

apiKey
String

API Key

endpoint
Uri

Endpoint / Target URI

httpClient
HttpClient

Custom HttpClient for HTTP requests.

serviceId
String

A local identifier for the given AI service

Returns

The same instance as services.

Applies to