Share via


AzureOpenAIClient Constructors

Definition

Overloads

AzureOpenAIClient()

Creates a new instance of AzureOpenAIClient for mocking.

AzureOpenAIClient(Uri, TokenCredential)

Creates a new instance of AzureOpenAIClient that will connect to an Azure OpenAI service resource using token authentication, including for tokens issued via managed identity.

AzureOpenAIClient(Uri, ApiKeyCredential)

Creates a new instance of AzureOpenAIClient that will connect to a specified Azure OpenAI service resource endpoint using an API key.

AzureOpenAIClient(ClientPipeline, Uri, AzureOpenAIClientOptions)

Creates a new instance of AzureOpenAIClient.

AzureOpenAIClient(Uri, TokenCredential, AzureOpenAIClientOptions)

Creates a new instance of AzureOpenAIClient that will connect to an Azure OpenAI service resource using token authentication, including for tokens issued via managed identity.

AzureOpenAIClient(Uri, ApiKeyCredential, AzureOpenAIClientOptions)

Creates a new instance of AzureOpenAIClient that will connect to a specified Azure OpenAI service resource endpoint using an API key.

AzureOpenAIClient()

Source:
AzureOpenAIClient.cs
Source:
AzureOpenAIClient.cs

Creates a new instance of AzureOpenAIClient for mocking.

protected AzureOpenAIClient ();
Protected Sub New ()

Applies to

AzureOpenAIClient(Uri, TokenCredential)

Source:
AzureOpenAIClient.cs
Source:
AzureOpenAIClient.cs

Creates a new instance of AzureOpenAIClient that will connect to an Azure OpenAI service resource using token authentication, including for tokens issued via managed identity.

public AzureOpenAIClient (Uri endpoint, Azure.Core.TokenCredential credential);
new Azure.AI.OpenAI.AzureOpenAIClient : Uri * Azure.Core.TokenCredential -> Azure.AI.OpenAI.AzureOpenAIClient
Public Sub New (endpoint As Uri, credential As TokenCredential)

Parameters

endpoint
Uri

The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com.

credential
TokenCredential

The token credential to authenticate with the service.

Remarks

For API-key-based authentication, please use the alternate constructor: AzureOpenAIClient(Uri, ApiKeyCredential, AzureOpenAIClientOptions)

Applies to

AzureOpenAIClient(Uri, ApiKeyCredential)

Source:
AzureOpenAIClient.cs
Source:
AzureOpenAIClient.cs

Creates a new instance of AzureOpenAIClient that will connect to a specified Azure OpenAI service resource endpoint using an API key.

public AzureOpenAIClient (Uri endpoint, System.ClientModel.ApiKeyCredential credential);
new Azure.AI.OpenAI.AzureOpenAIClient : Uri * System.ClientModel.ApiKeyCredential -> Azure.AI.OpenAI.AzureOpenAIClient
Public Sub New (endpoint As Uri, credential As ApiKeyCredential)

Parameters

endpoint
Uri

The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com.

credential
ApiKeyCredential

The API key to authenticate with the service.

Remarks

For token-based authentication, including the use of managed identity, please use the alternate constructor: AzureOpenAIClient(Uri, TokenCredential, AzureOpenAIClientOptions)

Applies to

AzureOpenAIClient(ClientPipeline, Uri, AzureOpenAIClientOptions)

Source:
AzureOpenAIClient.cs
Source:
AzureOpenAIClient.cs

Creates a new instance of AzureOpenAIClient.

protected AzureOpenAIClient (System.ClientModel.Primitives.ClientPipeline pipeline, Uri endpoint, Azure.AI.OpenAI.AzureOpenAIClientOptions options);
new Azure.AI.OpenAI.AzureOpenAIClient : System.ClientModel.Primitives.ClientPipeline * Uri * Azure.AI.OpenAI.AzureOpenAIClientOptions -> Azure.AI.OpenAI.AzureOpenAIClient
Protected Sub New (pipeline As ClientPipeline, endpoint As Uri, options As AzureOpenAIClientOptions)

Parameters

pipeline
ClientPipeline

The client pipeline to use.

endpoint
Uri

The endpoint to use.

options
AzureOpenAIClientOptions

The additional client options to use.

Applies to

AzureOpenAIClient(Uri, TokenCredential, AzureOpenAIClientOptions)

Source:
AzureOpenAIClient.cs
Source:
AzureOpenAIClient.cs

Creates a new instance of AzureOpenAIClient that will connect to an Azure OpenAI service resource using token authentication, including for tokens issued via managed identity.

public AzureOpenAIClient (Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options);
new Azure.AI.OpenAI.AzureOpenAIClient : Uri * Azure.Core.TokenCredential * Azure.AI.OpenAI.AzureOpenAIClientOptions -> Azure.AI.OpenAI.AzureOpenAIClient
Public Sub New (endpoint As Uri, credential As TokenCredential, options As AzureOpenAIClientOptions)

Parameters

endpoint
Uri

The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information.

Example: https://my-resource.openai.azure.com

credential
TokenCredential

The API key to use when authenticating with the provided endpoint.

options
AzureOpenAIClientOptions

The scenario-independent options to use.

Remarks

For API-key-based authentication, please use the alternate constructor: AzureOpenAIClient(Uri, ApiKeyCredential, AzureOpenAIClientOptions)

Applies to

AzureOpenAIClient(Uri, ApiKeyCredential, AzureOpenAIClientOptions)

Source:
AzureOpenAIClient.cs
Source:
AzureOpenAIClient.cs

Creates a new instance of AzureOpenAIClient that will connect to a specified Azure OpenAI service resource endpoint using an API key.

public AzureOpenAIClient (Uri endpoint, System.ClientModel.ApiKeyCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options);
new Azure.AI.OpenAI.AzureOpenAIClient : Uri * System.ClientModel.ApiKeyCredential * Azure.AI.OpenAI.AzureOpenAIClientOptions -> Azure.AI.OpenAI.AzureOpenAIClient
Public Sub New (endpoint As Uri, credential As ApiKeyCredential, options As AzureOpenAIClientOptions)

Parameters

endpoint
Uri

The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com.

credential
ApiKeyCredential

The API key to authenticate with the service.

options
AzureOpenAIClientOptions

The options to configure the client.

Remarks

For token-based authentication, including the use of managed identity, please use the alternate constructor: AzureOpenAIClient(Uri, TokenCredential, AzureOpenAIClientOptions)

Applies to