Skip to content

Consider adding OpenAIClient ctor for AuthenticationPolicy and Uri #754

@stephentoub

Description

@stephentoub

To use OpenAIClient (rather than AzureOpenAIClient) to connect to Azure OpenAI, you need to use an OpenAIClientOptions to set the endpoint, e.g.

OpenAIClient client = new(
    new BearerTokenPolicy(new AzureCliCredential(), "https://ai.azure.com/.default"),
    new OpenAIClientOptions()
    {
        Endpoint = new Uri(endpoint)
    };

It'd be a bit simpler if the Uri could just be passed to the constructor directly, e.g.

OpenAIClient client = new(
    new BearerTokenPolicy(new AzureCliCredential(), "https://ai.azure.com/.default"),
    new Uri(endpoint));

Metadata

Metadata

Assignees

Labels

area: architectureThis item is related to general architecture of the OpenAI client library.feature-requestCategory: A new feature or enhancement to an existing feature is being requested.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions