Skip to content

Create new ToolChatOptions if input request has tool configuration without options #3397

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 2 commits into
base: main
Choose a base branch
from

Conversation

filiphr
Copy link
Contributor

@filiphr filiphr commented May 30, 2025

This fixes a problem where the tool information is not provided to the underlying client if the prompt does not have any chat options set.

e.g.

chatClient.prompt().toolNames("myTool").call()

The example above will not provide the tool name to the underlying chat model through the request.

@markpollack markpollack added the bug Something isn't working label May 30, 2025
@markpollack markpollack added this to the 1.1.x milestone May 30, 2025
@@ -685,7 +689,7 @@ public List<Media> getMedia() {
return this.media;
}

public List<String> getToolNames() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set maybe more appropriate ,but at this point since it is GA, we can't change the API without doing a deprecation first. Probably isn't worth the hastle to change to Set

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the DefaultChatClientRequestSpec part of the API? I changed it to Set since the public API is actually using a Set. e.g. in DefaultToolCallingChatOptions also the ToolCallingChatOptions#toolNames.

In any case, you are right. I have reverted that change

@markpollack markpollack self-assigned this Jul 17, 2025
@filiphr filiphr force-pushed the provide-tool-options-when-no-options-are-set branch from f458765 to 74e3d25 Compare July 17, 2025 17:12
@filiphr
Copy link
Contributor Author

filiphr commented Jul 17, 2025

Seems like the failing test is failing on main as well.

@filiphr filiphr force-pushed the provide-tool-options-when-no-options-are-set branch from 74e3d25 to 67b962f Compare July 18, 2025 13:53
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.

4 participants