Skip to content

Conversation

@sunyuhan1998
Copy link
Contributor

@sunyuhan1998 sunyuhan1998 commented Jun 3, 2025

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.

Fixes #3392
Fixes #4169

…DefaultChatOptions. Signed-off-by: Sun Yuhan <1085481446@qq.com>
… to `DefaultToolCallingChatOptions` Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
@sunyuhan1998
Copy link
Contributor Author

Hi @markpollack , I just optimized some of the logic in this PR, and now it looks more concise. Could you please help review it? Thanks!

@sunyuhan1998
Copy link
Contributor Author

Hi @ilayaperumalg , could you please help review this PR? I noticed @markpollack might be quite busy recently. The changes in this PR are minimal, but they address a frequently occurring issue.

@ilayaperumalg
Copy link
Member

LGTM

@ilayaperumalg ilayaperumalg self-assigned this Sep 8, 2025
@ilayaperumalg
Copy link
Member

@sunyuhan1998 Thanks for the PR fixing the issue. Rebased and merged as a6dba7d

@ilayaperumalg
Copy link
Member

Cherry-picked and pushed into 1.0.x as 29158c82e9e59b59fd77c98e3c8fd34bb43ee07c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 participants