In our implementation where we orchestrate agents with LangGraph and stream chunks async, there is no place where it makes sense to add an Agent decorator, mostly because we are streaming the chunks async.
It makes more sense to pass the agent name in the metadata when the tools are bound to an agent so that each invocation contains the metadata, i.e.
but this means the metadata is only available on_chat_model_start. So here I added a check to see if that metadata is present, and add an additional event to denote that an agent started an action
In our implementation where we orchestrate agents with LangGraph and stream chunks async, there is no place where it makes sense to add an
Agent
decorator, mostly because we are streaming the chunks async.It makes more sense to pass the agent name in the metadata when the tools are bound to an agent so that each invocation contains the metadata, i.e.
but this means the metadata is only available
on_chat_model_start
. So here I added a check to see if that metadata is present, and add an additional event to denote that an agent started an action