Skip to content

Commit 0ff0f38

Browse files
committed
chore: Update A2A types from specification 🤖
1 parent 0e66e1f commit 0ff0f38

File tree

1 file changed

+43
-8
lines changed

1 file changed

+43
-8
lines changed

src/a2a/types.py

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,26 @@ class APIKeySecurityScheme(BaseModel):
4343
type: Literal['apiKey'] = 'apiKey'
4444

4545

46-
class AgentCapabilities(BaseModel):
46+
class AgentExtension(BaseModel):
4747
"""
48-
Defines optional capabilities supported by an agent.
48+
A declaration of an extension supported by an Agent.
4949
"""
5050

51-
pushNotifications: bool | None = None
51+
description: str | None = None
5252
"""
53-
true if the agent can notify updates to client.
53+
A description of how this agent uses this extension.
5454
"""
55-
stateTransitionHistory: bool | None = None
55+
params: dict[str, Any] | None = None
5656
"""
57-
true if the agent exposes status change history for tasks.
57+
Optional configuration for the extension.
5858
"""
59-
streaming: bool | None = None
59+
required: bool | None = None
6060
"""
61-
true if the agent supports SSE.
61+
Whether the client must follow specific requirements of the extension.
62+
"""
63+
uri: str
64+
"""
65+
The URI of the extension.
6266
"""
6367

6468

@@ -820,6 +824,29 @@ class A2AError(
820824
)
821825

822826

827+
class AgentCapabilities(BaseModel):
828+
"""
829+
Defines optional capabilities supported by an agent.
830+
"""
831+
832+
extensions: list[AgentExtension] | None = None
833+
"""
834+
extensions supported by this agent.
835+
"""
836+
pushNotifications: bool | None = None
837+
"""
838+
true if the agent can notify updates to client.
839+
"""
840+
stateTransitionHistory: bool | None = None
841+
"""
842+
true if the agent exposes status change history for tasks.
843+
"""
844+
streaming: bool | None = None
845+
"""
846+
true if the agent supports SSE.
847+
"""
848+
849+
823850
class CancelTaskRequest(BaseModel):
824851
"""
825852
JSON-RPC request model for the 'tasks/cancel' method.
@@ -1075,6 +1102,10 @@ class Artifact(BaseModel):
10751102
"""
10761103
Optional description for the artifact.
10771104
"""
1105+
extensions: list[str] | None = None
1106+
"""
1107+
The URIs of extensions that are present or contributed to this Artifact.
1108+
"""
10781109
metadata: dict[str, Any] | None = None
10791110
"""
10801111
Extension metadata.
@@ -1107,6 +1138,10 @@ class Message(BaseModel):
11071138
"""
11081139
The context the message is associated with
11091140
"""
1141+
extensions: list[str] | None = None
1142+
"""
1143+
The URIs of extensions that are present or contributed to this Message.
1144+
"""
11101145
kind: Literal['message'] = 'message'
11111146
"""
11121147
Event type

0 commit comments

Comments
 (0)