-
Notifications
You must be signed in to change notification settings - Fork 863
Description
Context:
uv pip list: agent-framework 1.0.0b251114
To have some sort of chat history in my workflows, I decided to aggregate after the workflow and destructure before agent initialization, for this I'm using a list of AgentExecutors initialized from a list of ChatAgents:
async def create_agent_executors(
agents: list[ChatAgent], serialized_threads: dict[str, dict[str, Any]]
) -> list[AgentExecutor]:
agent_executors = []
for agent in agents:
thread = await get_agent_thread(agent, serialized_threads)
agent_executors.append(AgentExecutor(agent=agent, agent_thread=thread))
return agent_executorsUsed function to create the workflow
def create_group_chat_workflow(self, agent_executors: list[AgentExecutor]) -> Workflow:
chat_client = self.get_chat_client(model="gpt-5-nano")
return (
GroupChatBuilder()
.set_prompt_based_manager(
chat_client=chat_client,
display_name="Coordinator",
)
.participants(agent_executors)
.build()
)Issue:
The coordinator isn't calling upon the other AgentExecutors and just terminates the workflow after an invoke.
Event output of the stream:
WorkflowStartedEvent(origin=WorkflowEventSource.FRAMEWORK, data=None)
WorkflowStatusEvent(state=WorkflowRunState.IN_PROGRESS, data=None, origin=WorkflowEventSource.FRAMEWORK)
ExecutorInvokedEvent(executor_id=groupchat_orchestrator_8c81020b, data=None)
ExecutorCompletedEvent(executor_id=groupchat_orchestrator_8c81020b, data=None)
WorkflowStatusEvent(state=WorkflowRunState.IDLE, data=None, origin=WorkflowEventSource.FRAMEWORK)
For this example I passed a web search agent and another custom built agent (which both work in other workflows).
Question:
Does the GroupChatBuilder not properly work with AgentExecutors? I've tried changing the "Coordinators" instruction with little success.
If AgentExecutors don't work as participants, how am I supposed to implement persistent chat history within abstract workflows such as GroupChatBuilder?