refactor: extract shared tool execution support - #1837
Conversation
|
@arnabnandy7 - will review and retest IT tests, thanks |
this PR should be merged before #1826, so with this that PR has two dependencies which should be resolved first before we act on it. |
igordayen
left a comment
There was a problem hiding this comment.
@arnabnandy7 - thanks, left few comments for consideration / as inquiries. regards
|
What is your vision of support if the number of tool loop implementations grows? Inheritance vs composition .... thanks And please mark as "resolved". |
My preference is composition for the shared tool-execution behavior. Each tool loop should own its orchestration model sequential, parallel, or others etc while reusing the common execution, callback, result-conversion, and injection logic.
If this shared logic eventually needs more dependencies or state, we can turn it into an injected support component instead of adding more responsibilities to the base class.
Done, all marked resolved. |
|
@arnabnandy7 testing PR, will update on completion of testing |
|
testing from embabel-agent-experimental repo. |
|
Found issue: requires upgrading |
|
Conclusion:
thanks |
Thanks for catching this. The failure happens during output-schema generation, before either tool-loop implementation executes, and both the default and parallel ITs fail with the same It looks like the experimental repository is resolving an incompatible VicTools I’ll align/upgrade the experimental repository’s Embabel BOM or dependency version and rerun the IT suite. This appears to be a runtime dependency alignment issue rather than a regression in the shared tool-execution change. |
|
@igordayen on another note, can you try running with I checked the dependency graph. This branch resolves The experimental repository uses the mutable There doesn’t appear to be a code change required in this PR. |
I will later in a day, a bit busy, outside, thanks for patience. |
|
|
mvn -U -Dtest='IT,!LLMOllamaIT' |
|
found: grep -r jackson . --include "*.java" |
|
@igordayen thanks, this confirms the mismatch is in the experimental integration-test module. It still explicitly depends on the Jackson 2 Kotlin module and resolves The Kotlin module dependency should be migrated to This should be fixed in Both |
|
embabel/embabel-agent-experimental#27 - refactoring passed after upgrade, thanks |
|
@arnabnandy7 - I'm ready to merge, as PR "Replace Spring AI deprecated API " got merged. Please confirm, thanks |
I'll prepare and let you know. Thanks 😊 |
601a8a1 to
844fe2b
Compare
I've synced this PR with main, please proceed. @igordayen |
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
844fe2b to
30e407b
Compare
|
I've squashed the commits as well. |
igordayen
left a comment
There was a problem hiding this comment.
@arnabnandy7 - all integration tests successfully passed, thank you
Summary
Extracts provider-independent tool execution and dynamic tool injection behavior from
DefaultToolLoopinto reusable support functions.This creates a shared foundation for other tool-loop implementations, including future streaming tool loops, without introducing streaming-specific behavior in this PR.
Changes
ToolInjectionStrategyevaluation.DefaultToolLoopto use the shared implementation.Motivation
Tool execution behavior was embedded in
DefaultToolLoop, making it difficult for other tool-loop implementations to reuse the same semantics. Centralizing this behavior avoids duplication and helps keep blocking, parallel, and future streaming implementations consistent.Testing
Result: 24 tests passed with no failures or errors.
Closes #1836