fasta2a
FastA2A
Bases: Starlette
The main class for the FastA2A library.
Source code in .venv/lib/python3.12/site-packages/fasta2a/applications.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
Broker
dataclass
Bases: ABC
The broker class is in charge of scheduling the tasks.
The HTTP server uses the broker to schedule tasks.
The simple implementation is the InMemoryBroker
, which is the broker that
runs the tasks in the same process as the HTTP server. That said, this class can be
extended to support remote workers.
Source code in .venv/lib/python3.12/site-packages/fasta2a/broker.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
run_task
abstractmethod
async
run_task(params: TaskSendParams) -> None
Send a task to be executed by the worker.
Source code in .venv/lib/python3.12/site-packages/fasta2a/broker.py
30 31 32 33 |
|
cancel_task
abstractmethod
async
cancel_task(params: TaskIdParams) -> None
Cancel a task.
Source code in .venv/lib/python3.12/site-packages/fasta2a/broker.py
35 36 37 38 |
|
receive_task_operations
abstractmethod
receive_task_operations() -> AsyncIterator[TaskOperation]
Receive task operations from the broker.
On a multi-worker setup, the broker will need to round-robin the task operations between the workers.
Source code in .venv/lib/python3.12/site-packages/fasta2a/broker.py
46 47 48 49 50 51 52 |
|
Skill
Bases: TypedDict
Skills are a unit of capability that an agent can perform.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
description
instance-attribute
description: str
A human-readable description of the skill.
It will be used by the client or a human as a hint to understand the skill.
tags
instance-attribute
Set of tag-words describing classes of capabilities for this specific skill.
Examples: "cooking", "customer support", "billing".
examples
instance-attribute
examples: NotRequired[list[str]]
The set of example scenarios that the skill can perform.
Will be used by the client as a hint to understand how the skill can be used. (e.g. "I need a recipe for bread")
Storage
A storage to retrieve and save tasks, as well as retrieve and save context.
The storage serves two purposes: 1. Task storage: Stores tasks in A2A protocol format with their status, artifacts, and message history 2. Context storage: Stores conversation context in a format optimized for the specific agent implementation
Source code in .venv/lib/python3.12/site-packages/fasta2a/storage.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
load_task
abstractmethod
async
Load a task from storage.
If the task is not found, return None.
Source code in .venv/lib/python3.12/site-packages/fasta2a/storage.py
25 26 27 28 29 30 |
|
submit_task
abstractmethod
async
Submit a task to storage.
Source code in .venv/lib/python3.12/site-packages/fasta2a/storage.py
32 33 34 |
|
update_task
abstractmethod
async
update_task(
task_id: str,
state: TaskState,
new_artifacts: list[Artifact] | None = None,
new_messages: list[Message] | None = None,
) -> Task
Update the state of a task. Appends artifacts and messages, if specified.
Source code in .venv/lib/python3.12/site-packages/fasta2a/storage.py
36 37 38 39 40 41 42 43 44 |
|
load_context
abstractmethod
async
load_context(context_id: str) -> ContextT | None
Retrieve the stored context given the context_id
.
Source code in .venv/lib/python3.12/site-packages/fasta2a/storage.py
46 47 48 |
|
update_context
abstractmethod
async
update_context(context_id: str, context: ContextT) -> None
Updates the context for a context_id
.
Implementing agent can decide what to store in context.
Source code in .venv/lib/python3.12/site-packages/fasta2a/storage.py
50 51 52 53 54 55 |
|
Worker
dataclass
A worker is responsible for executing tasks.
Source code in .venv/lib/python3.12/site-packages/fasta2a/worker.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
run
async
run() -> AsyncIterator[None]
Run the worker.
It connects to the broker, and it makes itself available to receive commands.
Source code in .venv/lib/python3.12/site-packages/fasta2a/worker.py
29 30 31 32 33 34 35 36 37 38 |
|
This module contains the schema for the agent card.
AgentCard
Bases: TypedDict
The card that describes an agent.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
description
instance-attribute
description: str
A human-readable description of the agent.
Used to assist users and other agents in understanding what the agent can do. (e.g. "Agent that helps users with recipes and cooking.")
version
instance-attribute
version: str
The version of the agent - format is up to the provider. (e.g. "1.0.0")
protocol_version
instance-attribute
protocol_version: str
The version of the A2A protocol this agent supports.
documentation_url
instance-attribute
documentation_url: NotRequired[str]
A URL to documentation for the agent.
preferred_transport
instance-attribute
preferred_transport: NotRequired[str]
The transport of the preferred endpoint. If empty, defaults to JSONRPC.
additional_interfaces
instance-attribute
additional_interfaces: NotRequired[list[AgentInterface]]
Announcement of additional supported transports.
security
instance-attribute
Security requirements for contacting the agent.
security_schemes
instance-attribute
security_schemes: NotRequired[dict[str, SecurityScheme]]
Security scheme definitions.
default_input_modes
instance-attribute
Supported mime types for input data.
AgentProvider
Bases: TypedDict
The service provider of the agent.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
72 73 74 75 76 |
|
AgentCapabilities
Bases: TypedDict
The capabilities of the agent.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
79 80 81 82 83 84 85 86 87 88 89 90 |
|
push_notifications
instance-attribute
push_notifications: NotRequired[bool]
Whether the agent can notify updates to client.
state_transition_history
instance-attribute
state_transition_history: NotRequired[bool]
Whether the agent exposes status change history for tasks.
HttpSecurityScheme
Bases: TypedDict
HTTP security scheme.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
93 94 95 96 97 98 99 100 101 102 103 |
|
bearer_format
instance-attribute
bearer_format: NotRequired[str]
A hint to the client to identify how the bearer token is formatted.
ApiKeySecurityScheme
Bases: TypedDict
API Key security scheme.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
106 107 108 109 110 111 112 113 114 115 116 |
|
OAuth2SecurityScheme
Bases: TypedDict
OAuth2 security scheme.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
119 120 121 122 123 124 125 126 127 |
|
flows
instance-attribute
An object containing configuration information for the flow types supported.
OpenIdConnectSecurityScheme
Bases: TypedDict
OpenID Connect security scheme.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
130 131 132 133 134 135 136 137 138 |
|
open_id_connect_url
instance-attribute
open_id_connect_url: str
OpenId Connect URL to discover OAuth2 configuration values.
SecurityScheme
module-attribute
SecurityScheme = Annotated[
Union[
HttpSecurityScheme,
ApiKeySecurityScheme,
OAuth2SecurityScheme,
OpenIdConnectSecurityScheme,
],
Field(discriminator="type"),
]
A security scheme for authentication.
AgentInterface
Bases: TypedDict
An interface that the agent supports.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
148 149 150 151 152 153 154 155 156 157 158 159 |
|
AgentExtension
Bases: TypedDict
A declaration of an extension supported by an Agent.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
description
instance-attribute
description: NotRequired[str]
A description of how this agent uses this extension.
required
instance-attribute
required: NotRequired[bool]
Whether the client must follow specific requirements of the extension.
params
instance-attribute
params: NotRequired[dict[str, Any]]
Optional configuration for the extension.
Skill
Bases: TypedDict
Skills are a unit of capability that an agent can perform.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
description
instance-attribute
description: str
A human-readable description of the skill.
It will be used by the client or a human as a hint to understand the skill.
tags
instance-attribute
Set of tag-words describing classes of capabilities for this specific skill.
Examples: "cooking", "customer support", "billing".
examples
instance-attribute
examples: NotRequired[list[str]]
The set of example scenarios that the skill can perform.
Will be used by the client as a hint to understand how the skill can be used. (e.g. "I need a recipe for bread")
Artifact
Bases: TypedDict
Agents generate Artifacts as an end result of a Task.
Artifacts are immutable, can be named, and can have multiple parts. A streaming response can append parts to existing Artifacts.
A single Task can generate many Artifacts. For example, "create a webpage" could create separate HTML and image Artifacts.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
|
append
instance-attribute
append: NotRequired[bool]
Whether to append this artifact to an existing one.
last_chunk
instance-attribute
last_chunk: NotRequired[bool]
Whether this is the last chunk of the artifact.
PushNotificationConfig
Bases: TypedDict
Configuration for push notifications.
A2A supports a secure notification mechanism whereby an agent can notify a client of an update outside of a connected session via a PushNotificationService. Within and across enterprises, it is critical that the agent verifies the identity of the notification service, authenticates itself with the service, and presents an identifier that ties the notification to the executing Task.
The target server of the PushNotificationService should be considered a separate service, and is not guaranteed (or even expected) to be the client directly. This PushNotificationService is responsible for authenticating and authorizing the agent and for proxying the verified notification to the appropriate endpoint (which could be anything from a pub/sub queue, to an email inbox or other service, etc).
For contrived scenarios with isolated client-agent pairs (e.g. local service mesh in a contained VPC, etc.) or isolated environments without enterprise security concerns, the client may choose to simply open a port and act as its own PushNotificationService. Any enterprise implementation will likely have a centralized service that authenticates the remote agents with trusted notification credentials and can handle online/offline scenarios. (This should be thought of similarly to a mobile Push Notification Service).
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
|
authentication
instance-attribute
authentication: NotRequired[SecurityScheme]
Authentication details for push notifications.
TaskPushNotificationConfig
Bases: TypedDict
Configuration for task push notifications.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
287 288 289 290 291 292 293 294 295 |
|
push_notification_config
instance-attribute
push_notification_config: PushNotificationConfig
The push notification configuration.
Message
Bases: TypedDict
A Message contains any content that is not an Artifact.
This can include things like agent thoughts, user context, instructions, errors, status, or metadata.
All content from a client comes in the form of a Message. Agents send Messages to communicate status or to provide instructions (whereas generated results are sent as Artifacts).
A Message can have multiple parts to denote different pieces of content. For example, a user request could include a textual description from a user and then multiple files used as context from the client.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
|
context_id
instance-attribute
context_id: NotRequired[str]
The context the message is associated with.
reference_task_ids
instance-attribute
reference_task_ids: NotRequired[list[str]]
Array of task IDs this message references.
TextPart
Bases: _BasePart
A part that contains text.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
346 347 348 349 350 351 352 353 354 |
|
FileWithBytes
Bases: TypedDict
File with base64 encoded data.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
357 358 359 360 361 362 363 364 365 |
|
FileWithUri
Bases: TypedDict
File with URI reference.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
368 369 370 371 372 373 374 375 376 |
|
FilePart
Bases: _BasePart
A part that contains a file.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
379 380 381 382 383 384 385 386 387 |
|
DataPart
Bases: _BasePart
A part that contains structured data.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
390 391 392 393 394 395 396 397 398 |
|
Part
module-attribute
A fully formed piece of content exchanged between a client and a remote agent as part of a Message or an Artifact.
Each Part has its own content type and metadata.
TaskState
module-attribute
TaskState: TypeAlias = Literal[
"submitted",
"working",
"input-required",
"completed",
"canceled",
"failed",
"rejected",
"auth-required",
"unknown",
]
The possible states of a task.
TaskStatus
Bases: TypedDict
Status and accompanying message for a task.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
413 414 415 416 417 418 419 420 421 422 423 424 |
|
timestamp
instance-attribute
timestamp: NotRequired[str]
ISO datetime value of when the status was updated.
Task
Bases: TypedDict
A Task is a stateful entity that allows Clients and Remote Agents to achieve a specific outcome.
Clients and Remote Agents exchange Messages within a Task. Remote Agents generate results as Artifacts. A Task is always created by a Client and the status is always determined by the Remote Agent.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
|
artifacts
instance-attribute
artifacts: NotRequired[list[Artifact]]
Collection of artifacts created by the agent.
TaskStatusUpdateEvent
Bases: TypedDict
Sent by server during message/stream requests.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
|
TaskArtifactUpdateEvent
Bases: TypedDict
Sent by server during message/stream requests.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 |
|
append
instance-attribute
append: NotRequired[bool]
Whether to append to existing artifact (true) or replace (false).
last_chunk
instance-attribute
last_chunk: NotRequired[bool]
Indicates this is the final chunk of the artifact.
TaskIdParams
Bases: TypedDict
Parameters for a task id.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
506 507 508 509 510 511 |
|
TaskQueryParams
Bases: TaskIdParams
Query parameters for a task.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
514 515 516 517 518 519 |
|
history_length
instance-attribute
history_length: NotRequired[int]
Number of recent messages to be retrieved.
MessageSendConfiguration
Bases: TypedDict
Configuration for the send message request.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 |
|
accepted_output_modes
instance-attribute
Accepted output modalities by the client.
blocking
instance-attribute
blocking: NotRequired[bool]
If the server should treat the client as a blocking request.
history_length
instance-attribute
history_length: NotRequired[int]
Number of recent messages to be retrieved.
push_notification_config
instance-attribute
push_notification_config: NotRequired[
PushNotificationConfig
]
Where the server should send notifications when disconnected.
MessageSendParams
Bases: TypedDict
Parameters for message/send method.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
539 540 541 542 543 544 545 546 547 548 549 550 |
|
configuration
instance-attribute
configuration: NotRequired[MessageSendConfiguration]
Send message configuration.
TaskSendParams
Bases: TypedDict
Internal parameters for task execution within the framework.
Note: This is not part of the A2A protocol - it's used internally for broker/worker communication.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 |
|
history_length
instance-attribute
history_length: NotRequired[int]
Number of recent messages to be retrieved.
ListTaskPushNotificationConfigParams
Bases: TypedDict
Parameters for getting list of pushNotificationConfigurations associated with a Task.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
577 578 579 580 581 582 583 584 585 |
|
DeleteTaskPushNotificationConfigParams
Bases: TypedDict
Parameters for removing pushNotificationConfiguration associated with a Task.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
588 589 590 591 592 593 594 595 596 597 598 599 |
|
JSONRPCMessage
Bases: TypedDict
A JSON RPC message.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
602 603 604 605 606 607 608 609 |
|
JSONRPCRequest
Bases: JSONRPCMessage
, Generic[Method, Params]
A JSON RPC request.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
616 617 618 619 620 621 622 623 |
|
method
instance-attribute
method: Method
The method to call.
params
instance-attribute
params: Params
The parameters to pass to the method.
JSONRPCError
JSONRPCResponse
Bases: JSONRPCMessage
, Generic[ResultT, ErrorT]
A JSON RPC response.
Source code in .venv/lib/python3.12/site-packages/fasta2a/schema.py
646 647 648 649 650 |
|
JSONParseError
module-attribute
JSONParseError = JSONRPCError[
Literal[-32700], Literal["Invalid JSON payload"]
]
A JSON RPC error for a parse error.
InvalidRequestError
module-attribute
InvalidRequestError = JSONRPCError[
Literal[-32600],
Literal["Request payload validation error"],
]
A JSON RPC error for an invalid request.
MethodNotFoundError
module-attribute
MethodNotFoundError = JSONRPCError[
Literal[-32601], Literal["Method not found"]
]
A JSON RPC error for a method not found.
InvalidParamsError
module-attribute
InvalidParamsError = JSONRPCError[
Literal[-32602], Literal["Invalid parameters"]
]
A JSON RPC error for invalid parameters.
InternalError
module-attribute
InternalError = JSONRPCError[
Literal[-32603], Literal["Internal error"]
]
A JSON RPC error for an internal error.
TaskNotFoundError
module-attribute
TaskNotFoundError = JSONRPCError[
Literal[-32001], Literal["Task not found"]
]
A JSON RPC error for a task not found.
TaskNotCancelableError
module-attribute
TaskNotCancelableError = JSONRPCError[
Literal[-32002], Literal["Task not cancelable"]
]
A JSON RPC error for a task not cancelable.
PushNotificationNotSupportedError
module-attribute
PushNotificationNotSupportedError = JSONRPCError[
Literal[-32003],
Literal["Push notification not supported"],
]
A JSON RPC error for a push notification not supported.
UnsupportedOperationError
module-attribute
UnsupportedOperationError = JSONRPCError[
Literal[-32004],
Literal["This operation is not supported"],
]
A JSON RPC error for an unsupported operation.
ContentTypeNotSupportedError
module-attribute
ContentTypeNotSupportedError = JSONRPCError[
Literal[-32005], Literal["Incompatible content types"]
]
A JSON RPC error for incompatible content types.
InvalidAgentResponseError
module-attribute
InvalidAgentResponseError = JSONRPCError[
Literal[-32006], Literal["Invalid agent response"]
]
A JSON RPC error for invalid agent response.
SendMessageRequest
module-attribute
SendMessageRequest = JSONRPCRequest[
Literal["message/send"], MessageSendParams
]
A JSON RPC request to send a message.
SendMessageResponse
module-attribute
SendMessageResponse = JSONRPCResponse[
Union[Task, Message], JSONRPCError[Any, Any]
]
A JSON RPC response to send a message.
StreamMessageRequest
module-attribute
StreamMessageRequest = JSONRPCRequest[
Literal["message/stream"], MessageSendParams
]
A JSON RPC request to stream a message.
GetTaskRequest
module-attribute
GetTaskRequest = JSONRPCRequest[
Literal["tasks/get"], TaskQueryParams
]
A JSON RPC request to get a task.
GetTaskResponse
module-attribute
GetTaskResponse = JSONRPCResponse[Task, TaskNotFoundError]
A JSON RPC response to get a task.
CancelTaskRequest
module-attribute
CancelTaskRequest = JSONRPCRequest[
Literal["tasks/cancel"], TaskIdParams
]
A JSON RPC request to cancel a task.
CancelTaskResponse
module-attribute
CancelTaskResponse = JSONRPCResponse[
Task, Union[TaskNotCancelableError, TaskNotFoundError]
]
A JSON RPC response to cancel a task.
SetTaskPushNotificationRequest
module-attribute
SetTaskPushNotificationRequest = JSONRPCRequest[
Literal["tasks/pushNotification/set"],
TaskPushNotificationConfig,
]
A JSON RPC request to set a task push notification.
SetTaskPushNotificationResponse
module-attribute
SetTaskPushNotificationResponse = JSONRPCResponse[
TaskPushNotificationConfig,
PushNotificationNotSupportedError,
]
A JSON RPC response to set a task push notification.
GetTaskPushNotificationRequest
module-attribute
GetTaskPushNotificationRequest = JSONRPCRequest[
Literal["tasks/pushNotification/get"], TaskIdParams
]
A JSON RPC request to get a task push notification.
GetTaskPushNotificationResponse
module-attribute
GetTaskPushNotificationResponse = JSONRPCResponse[
TaskPushNotificationConfig,
PushNotificationNotSupportedError,
]
A JSON RPC response to get a task push notification.
ResubscribeTaskRequest
module-attribute
ResubscribeTaskRequest = JSONRPCRequest[
Literal["tasks/resubscribe"], TaskIdParams
]
A JSON RPC request to resubscribe to a task.
ListTaskPushNotificationConfigRequest
module-attribute
ListTaskPushNotificationConfigRequest = JSONRPCRequest[
Literal["tasks/pushNotificationConfig/list"],
ListTaskPushNotificationConfigParams,
]
A JSON RPC request to list task push notification configs.
DeleteTaskPushNotificationConfigRequest
module-attribute
DeleteTaskPushNotificationConfigRequest = JSONRPCRequest[
Literal["tasks/pushNotificationConfig/delete"],
DeleteTaskPushNotificationConfigParams,
]
A JSON RPC request to delete a task push notification config.
A2ARequest
module-attribute
A2ARequest = Annotated[
Union[
SendMessageRequest,
StreamMessageRequest,
GetTaskRequest,
CancelTaskRequest,
SetTaskPushNotificationRequest,
GetTaskPushNotificationRequest,
ResubscribeTaskRequest,
ListTaskPushNotificationConfigRequest,
DeleteTaskPushNotificationConfigRequest,
],
Discriminator("method"),
]
A JSON RPC request to the A2A server.
A2AResponse
module-attribute
A2AResponse: TypeAlias = Union[
SendMessageResponse,
GetTaskResponse,
CancelTaskResponse,
SetTaskPushNotificationResponse,
GetTaskPushNotificationResponse,
]
A JSON RPC response from the A2A server.
A2AClient
A client for the A2A protocol.
Source code in .venv/lib/python3.12/site-packages/fasta2a/client.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
send_message
async
send_message(
message: Message,
*,
metadata: dict[str, Any] | None = None,
configuration: MessageSendConfiguration | None = None
) -> SendMessageResponse
Send a message using the A2A protocol.
Returns a JSON-RPC response containing either a result (Task) or an error.
Source code in .venv/lib/python3.12/site-packages/fasta2a/client.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
UnexpectedResponseError
Bases: Exception
An error raised when an unexpected response is received from the server.
Source code in .venv/lib/python3.12/site-packages/fasta2a/client.py
78 79 80 81 82 83 |
|