[CaptainAgent] Add executor injected with tools. #307
Merged
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.
Current tools in ag2 can only be called via function calling/tool calling. This relies on the capability of the backend LLM. Another way of orchestrating tools is to use python coding to call and orchestrate the results. Introducing
LocalExecutorWithTools
, a customized executor that can call the functions underling the ag2 tools. The executor takes in a list of ag2 tools when instantiated, and extract thefunc
field within them. An example usage is:On the side of agents, they just need to call the function with no declarations needed and the results will be provided. The provides a more LLM-friendly way of orchestrating tool usage.
This PR is the preliminary of integrating cross platform tool into CaptainAgent. This is because the agents in groupchat assembled by CaptainAgent use tools as freeform coding. In order to adapt the tool-calling based ag2 tools into CaptainAgent, an executor injected with the namspace of the tool names is needed.
Why are these changes needed?
Related issue number
#286
Roadmap
The next PR will add the full content of the integration code and the notebook demonstrating the usage.
Checks