Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
examples: open the A2A task before emitting a status update
Tomas Tormo35c10a3f2e51
diff --git a/development/examples/chat-a2a/agent.py b/development/examples/chat-a2a/agent.pyindex 9eeaeb34..eaead9e1 100644--- a/development/examples/chat-a2a/agent.py+++ b/development/examples/chat-a2a/agent.py@@ -13,12 +13,14 @@ from a2a.server.request_handlers import DefaultRequestHandlerfrom a2a.server.routes import create_agent_card_routes, create_jsonrpc_routesfrom a2a.server.tasks.inmemory_task_store import InMemoryTaskStorefrom a2a.server.tasks.task_updater import TaskUpdater+from a2a.helpers.proto_helpers import new_taskfrom a2a.types import (AgentCapabilities,AgentCard,AgentInterface,AgentSkill,Part,+ TaskState,)from google import genaifrom google.genai import types@@ -109,6 +111,11 @@ class ChatExecutor(AgentExecutor):flush=True,)updater = TaskUpdater(event_queue, context.task_id, context.context_id)+ # The runtime rejects a status update as a task's first event.+ if context.current_task is None:+ await event_queue.enqueue_event(+ new_task(context.task_id, context.context_id, TaskState.TASK_STATE_SUBMITTED)+ )calls = reply.function_calls or []if calls and calls[0].name == "ask_user":self.pending_question.add(context.context_id)