Is there an existing issue for this?
Describe the bug
Description
// AppHost
IResourceBuilder<ParameterResource> deepSeekApiKey = builder.AddParameter("deepseek-api-key", true);
IResourceBuilder<ConnectionStringResource> deepSeekConnectionString = builder.AddConnectionString(
"deepseek",
connectionStringBuilder => connectionStringBuilder.Append(
$"Endpoint=https://api.deepseek.com/;Key={deepSeekApiKey};Model=deepseek-chat"));
// Consumer
builder.AddKeyedOpenAIClientFromConfiguration("deepseek").AddKeyedChatClient("deepseek")
// or
builder.AddKeyedOpenAI("deepseek").AddKeyedChatClient("deepseek")
// more? such as Azure?
For keyed client, they won't apply the configured connection string. It will keep using the OpenAIClientOptions with default named option. I think the results depend on whether you've configured the default named option, if not, it will use the default value of the OpenAIClientOptions. And the connectionstring, key and model are incorrect for keyed clients.
Cause
We need to manage named option here, and I did not take further investigation for azure related, not sure whether they are using this.
https://github.com/dotnet/aspire/blob/c8522bcdad5d092358f55e88af568a8c879b3147/src/Components/Aspire.OpenAI/AspireOpenAIExtensions.cs#L127
Expected Behavior
Make sure keyed OpenAI related services can be configured normally.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version info
No response
Anything else?
No response
Is there an existing issue for this?
Describe the bug
Description
For keyed client, they won't apply the configured connection string. It will keep using the
OpenAIClientOptionswith default named option. I think the results depend on whether you've configured the default named option, if not, it will use the default value of theOpenAIClientOptions. And the connectionstring, key and model are incorrect for keyed clients.Cause
We need to manage named option here, and I did not take further investigation for azure related, not sure whether they are using this.
https://github.com/dotnet/aspire/blob/c8522bcdad5d092358f55e88af568a8c879b3147/src/Components/Aspire.OpenAI/AspireOpenAIExtensions.cs#L127
Expected Behavior
Make sure keyed OpenAI related services can be configured normally.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version info
No response
Anything else?
No response