- Issue created by @yautja_cetanu
- 🇩🇪Germany marcus_johansson
Doublet of 📌 Allow the Assistant and Chatbot access to the tool calling within the sub-agents behind agent tool calls. Active - setting to postponed, because this might turn into a meta issue.
- 🇦🇺Australia RichardGaunt Melbourne
This has been an area of interest to me while working on a project that is using the ai_agents.
I've been attempting to get access to the communication between AI Provider and the assistant / agents in the process.
I have been wanting to pass contextual data from the top-level process through an agent and all its sub-agents/functions, so that this context is accessible in my event subscribers for PreGenerateResponseEvent and PostGenerateResponseEvent (dispatched in \Drupal\ai\Plugin\ProviderProxy).
Note this is not data to be consumed by the provider just accessible so I can carry out different actions within the subscribers.
I've attempted to pass contextual data that is preserved in \Drupal\ai_agents\PluginBase\AiAgentEntityWrapper and passed to the provider (\Drupal\ai\Plugin\ProviderProxy::wrapperCall) method by:
1. Setting ChatInput metadata - but this gets rebuilt/lost in the agent wrapper
2. Setting Debug data to ChatInput - but this also gets overwritten in the agent wrapper
3. Extra tags/user interface - but this method is not implemented in Agent WrapperMy personal fix for now has been to set an identifiable $runnerId on the agent that will orchestrate the other agents, then I have patched the AiAgentEntityWrapper class to set this same $runnerId
I've uploaded the patch knowing that this is not the fix that should be implemented but gives an idea of how to pass contextual information through the different tools in the process.