fix(core): allow tool callbacks and providers directly in ChatClient tools()#6263
Closed
Baqirrizvidev wants to merge 1 commit into
Closed
fix(core): allow tool callbacks and providers directly in ChatClient tools()#6263Baqirrizvidev wants to merge 1 commit into
Baqirrizvidev wants to merge 1 commit into
Conversation
Contributor
|
Superseded by #6275. |
Contributor
|
After discussing with @tzolov and @ilayaperumalg, we are considering this approach so let's reopen it. |
tzolov
added a commit
that referenced
this pull request
Jun 4, 2026
ChatClientRequestSpec.tools(Object...) now routes ToolCallback and ToolCallbackProvider instances directly to their respective lists instead of passing them to ToolCallbacks.from(), with null-element guards added for array and Collection arguments. Simplify all call sites from .tools(t -> t.callbacks(X)) to .tools(X) and update docs accordingly. See #6206 Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com> Co-authored-by: Christian Tzolov <christian.tzolov@broadcom.com>
Contributor
|
rebased, extended, squashed and merged at 699ad98 |
tzolov
added a commit
to tzolov/spring-ai
that referenced
this pull request
Jun 4, 2026
Follow-up to spring-projects#6263: now that tools(Object...) accepts ToolCallback and ToolCallbackProvider directly, the ToolSpec consumer overloads are no longer needed. Remove tools(Consumer<ToolSpec>), defaultTools(Consumer<ToolSpec>), and the ChatClient.ToolSpec interface entirely. toolContext() and defaultToolContext() are promoted to first-class non-deprecated methods with full key/value validation. mutate() is fixed to propagate toolCallbackProviders and toolContext to the cloned builder. Align tests and docs with IllegalArgumentException change in MethodToolCallbackProvider Update docs and tests accordingly. See spring-projects#6206 Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
tzolov
added a commit
to tzolov/spring-ai
that referenced
this pull request
Jun 4, 2026
Follow-up to spring-projects#6263: now that tools(Object...) accepts ToolCallback and ToolCallbackProvider directly, the ToolSpec consumer overloads are no longer needed. Remove tools(Consumer<ToolSpec>), defaultTools(Consumer<ToolSpec>), and the ChatClient.ToolSpec interface entirely. toolContext() and defaultToolContext() are promoted to first-class non-deprecated methods with full key/value validation. mutate() is fixed to propagate toolCallbackProviders and toolContext to the cloned builder. Align tests and docs with IllegalArgumentException change in MethodToolCallbackProvider Update docs and tests accordingly. See spring-projects#6206 Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
tzolov
added a commit
that referenced
this pull request
Jun 4, 2026
Follow-up to #6263: now that tools(Object...) accepts ToolCallback and ToolCallbackProvider directly, the ToolSpec consumer overloads are no longer needed. Remove tools(Consumer<ToolSpec>), defaultTools(Consumer<ToolSpec>), and the ChatClient.ToolSpec interface entirely. toolContext() and defaultToolContext() are promoted to first-class non-deprecated methods with full key/value validation. mutate() is fixed to propagate toolCallbackProviders and toolContext to the cloned builder. Align tests and docs with IllegalArgumentException change in MethodToolCallbackProvider Update docs and tests accordingly. See #6206 Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #6206. Permitting ChatClient.prompt().tools(...) to accept ToolCallback, ToolCallbackProvider, collections, and arrays of them directly, matching user expectations after deprecation of toolCallbacks(...).