Protocol Module#
- class isek.protocol.protocol.Protocol(host: str = 'localhost', port: int = 8080, p2p: bool = False, p2p_server_port: int = 9000, adapter: Adapter | None = None, **kwargs: Any)[source]#
Bases:
ABC
- class isek.protocol.a2a_protocol.A2AProtocol(a2a_application: JSONRPCApplication | None = None, host: str = 'localhost', port: int = 8080, p2p: bool = True, p2p_server_port: int = 9000, adapter: Adapter | None = None, **kwargs: Any)[source]#
Bases:
Protocol
- class isek.protocol.a2a_protocol.DefaultAgentExecutor(url: str, adapter: Adapter)[source]#
Bases:
AgentExecutor
- async cancel(context: RequestContext, event_queue: EventQueue) None [source]#
Request the agent to cancel an ongoing task.
The agent should attempt to stop the task identified by the task_id in the context and publish a TaskStatusUpdateEvent with state TaskState.canceled to the event_queue.
- Parameters:
context -- The request context containing the task ID to cancel.
event_queue -- The queue to publish the cancellation status update to.
- async execute(context: RequestContext, event_queue: EventQueue) None [source]#
Execute the agent's logic for a given request context.
The agent should read necessary information from the context and publish Task or Message events, or TaskStatusUpdateEvent / TaskArtifactUpdateEvent to the event_queue. This method should return once the agent's execution for this request is complete or yields control (e.g., enters an input-required state).
- Parameters:
context -- The request context containing the message, task ID, etc.
event_queue -- The queue to publish events to.