Skip to content

Fixed the issue where tool call information was lost when using DefaultChatOptions. #3417

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

sunyuhan1998
Copy link
Contributor

@sunyuhan1998 sunyuhan1998 commented Jun 3, 2025

Fixes #3392
As #3392 mentioned, when constructing ChatOptions using the ChatOptions.builder().build() form, the default instance generated is DefaultChatOptions.

When building the ChatClientRequest, tool call information is lost, causing the tool information to fail to be passed to the LLM, regardless of whether the user uses .defaultToolCallbacks() or directly calls tools() on the ChatClient.

This PR fixes the issue by converting the ChatOptions to DefaultToolCallingChatOptions during the construction of the ChatClientRequest, if the ChatOptions is determined to be a DefaultChatOptions and tool call information exists in the request.

…DefaultChatOptions.

Signed-off-by: Sun Yuhan <1085481446@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

configuring defaultOptions can cause defaultToolCallbacks failure
3 participants