Skip to content

Create a smarter OpenAI chat client that honors model ID#58

Merged
kzu merged 1 commit intomainfrom
dev/OpenAI
Jul 2, 2025
Merged

Create a smarter OpenAI chat client that honors model ID#58
kzu merged 1 commit intomainfrom
dev/OpenAI

Conversation

@kzu
Copy link
Copy Markdown
Member

@kzu kzu commented Jul 2, 2025

When using IChatClient API, the ChatOptions.ModelId is ignored by the built-in OpenAI implementation obtained by invoking OpenAIClient.GetChatClient("model").AsIChatClient. This is because the GetChatClient stores the model passed in and doesn't respect the options-specified one after initial creation.

We now align our own implementation of IChatClient for OpenAI so it behaves like Grok's, allowing more flexible usage while following the natural expectation set by having a writable ChatOptions.ModelId in the first place :).

When using `IChatClient` API, the `ChatOptions.ModelId` is ignored by the built-in OpenAI implementation obtained by invoking `OpenAIClient.GetChatClient("model").AsIChatClient`. This is because the `GetChatClient` stores the model passed in and doesn't respect the options-specified one after initial creation.

We now align our own implementation of `IChatClient` for OpenAI so it behaves like Grok's, allowing more flexible usage while following the natural expectation set by having a writable `ChatOptions.ModelId` in the first place :).
@kzu kzu added the enhancement New feature or request label Jul 2, 2025
@kzu kzu enabled auto-merge (rebase) July 2, 2025 21:15
@kzu
Copy link
Copy Markdown
Member Author

kzu commented Jul 2, 2025

7 skipped 7 skipped

🧪 Details on Ubuntu 24.04.2 LTS

from dotnet-retest v0.7.1 on .NET 8.0.17 with 💜 by @devlooped

@kzu kzu merged commit f017650 into main Jul 2, 2025
7 checks passed
@kzu kzu deleted the dev/OpenAI branch July 2, 2025 21:16
@devlooped devlooped locked and limited conversation to collaborators Aug 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant