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

abstractmethod bootstrap_p2p_extension()[source]#
abstractmethod bootstrap_server()[source]#
abstractmethod send_message(sender_node_id, target_address, message)[source]#
abstractmethod send_p2p_message(sender_node_id, p2p_address, message)[source]#
abstractmethod stop_server() None[source]#
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

bootstrap_p2p_extension()[source]#
bootstrap_server()[source]#
build_a2a_application() JSONRPCApplication[source]#
default_a2a_application()[source]#
send_message(sender_node_id, target_address, message)[source]#
send_p2p_message(sender_node_id, p2p_address, message)[source]#
stop_server() None[source]#
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.

get_a2a_agent_card() AgentCard[source]#
isek.protocol.a2a_protocol.build_send_message_request(sender_node_id, message)[source]#