Skip to content

Commit c61f613

Browse files
Merge branch 'main' into sdk_buf
2 parents df9c198 + 382e62d commit c61f613

File tree

3 files changed

+45
-13
lines changed

3 files changed

+45
-13
lines changed

.github/workflows/linter.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ jobs:
6464
VALIDATE_GIT_COMMITLINT: false
6565
PYTHON_MYPY_CONFIG_FILE: .mypy.ini
6666
FILTER_REGEX_INCLUDE: "^src/**"
67+
PYTHON_RUFF_CONFIG_FILE: .ruff.toml

.ruff.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ ignore = [
1818
"FBT002",
1919
"D203",
2020
"D213",
21-
"ANN001",
22-
"ANN201",
23-
"ANN204",
2421
"D100", # Ignore Missing docstring in public module (often desired at top level __init__.py)
25-
"D102", # Ignore return type annotation in public method
2622
"D104", # Ignore Missing docstring in public package (often desired at top level __init__.py)
2723
"D107", # Ignore Missing docstring in __init__ (use class docstring)
2824
"TD002", # Ignore Missing author in TODOs (often not required)
@@ -116,7 +112,7 @@ docstring-quotes = "double"
116112
inline-quotes = "single"
117113

118114
[lint.per-file-ignores]
119-
"__init__.py" = ["F401"] # Ignore unused imports in __init__.py
115+
"__init__.py" = ["F401", "D", "ANN"] # Ignore unused imports in __init__.py
120116
"*_test.py" = ["D", "ANN"] # Ignore docstring and annotation issues in test files
121117
"test_*.py" = ["D", "ANN"] # Ignore docstring and annotation issues in test files
122118
"types.py" = ["D", "E501", "N815"] # Ignore docstring and annotation issues in types.py

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)