AzureAIInferenceServiceCollectionExtensions.AddAzureAIInferenceChatCompletion Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddAzureAIInferenceChatCompletion(IServiceCollection, String, ChatCompletionsClient, String)
Adds the AzureAIInferenceChatCompletionService 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 the AzureAIInferenceChatCompletionService 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 for endpoints supporting more than one model
- 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 the AzureAIInferenceChatCompletionService to the IServiceCollection.
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAzureAIInferenceChatCompletion (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string? modelId = default, 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, Optional modelId As String = Nothing, 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 for endpoints supporting more than one model
- 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
.