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));
To use OpenAIClient (rather than AzureOpenAIClient) to connect to Azure OpenAI, you need to use an OpenAIClientOptions to set the endpoint, e.g.
It'd be a bit simpler if the Uri could just be passed to the constructor directly, e.g.