Skip to content

Adds support for retrieving the model name directly from DefaultChatClient #3889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zjxzjw
Copy link

@zjxzjw zjxzjw commented Jul 23, 2025

✨ PR: Expose Model Name from ChatClient

📝 Summary

This PR adds support for retrieving the model name directly from DefaultChatClient.

🚀 Motivation

In multi-model environments, we often need to log or observe which underlying model is being used (e.g., gpt-4o, llama3, etc.).
Currently, this requires injecting both ChatClient and ChatModel, or rebuilding the client manually.
This change simplifies the process and improves observability.

🔧 Changes


  • 🧠 Stored the ChatModel inside DefaultChatClient for later access
  • 🏗️ Modified DefaultChatClientBuilder to pass the ChatModel when building
  • ✅ Added unit test to validate the new functionality

This PR resolves issue #3790

Signed-off-by: engineer <jiaxingengineer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant