Skip to content

Commit 3efd1df

Browse files
committed
docs: fix docstrings related to CallContextBuilder args in constructors
1 parent 5b2475e commit 3efd1df

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/a2a/server/routes/jsonrpc_dispatcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ def __init__( # noqa: PLR0913
209209
extended_agent_card: An optional, distinct AgentCard to be served
210210
at the authenticated extended card endpoint.
211211
context_builder: The CallContextBuilder used to construct the
212-
ServerCallContext passed to the http_handler. If None, no
213-
ServerCallContext is passed.
212+
ServerCallContext passed to the http_handler. If None the
213+
DefaultCallContextBuilder is used.
214214
card_modifier: An optional callback to dynamically modify the public
215215
agent card before it is served.
216216
extended_card_modifier: An optional callback to dynamically modify

src/a2a/server/routes/jsonrpc_routes.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from a2a.server.request_handlers.request_handler import RequestHandler
2222
from a2a.server.routes.jsonrpc_dispatcher import (
2323
CallContextBuilder,
24+
DefaultCallContextBuilder,
2425
JsonRpcDispatcher,
2526
)
2627
from a2a.types.a2a_pb2 import AgentCard
@@ -54,8 +55,8 @@ def create_jsonrpc_routes( # noqa: PLR0913
5455
extended_agent_card: An optional, distinct AgentCard to be served
5556
at the authenticated extended card endpoint.
5657
context_builder: The CallContextBuilder used to construct the
57-
ServerCallContext passed to the request_handler. If None, no
58-
ServerCallContext is passed.
58+
ServerCallContext passed to the request_handler. If None the
59+
DefaultCallContextBuilder is used.
5960
card_modifier: An optional callback to dynamically modify the public
6061
agent card before it is served.
6162
extended_card_modifier: An optional callback to dynamically modify
@@ -74,7 +75,7 @@ def create_jsonrpc_routes( # noqa: PLR0913
7475
agent_card=agent_card,
7576
http_handler=request_handler,
7677
extended_agent_card=extended_agent_card,
77-
context_builder=context_builder,
78+
context_builder=context_builder or DefaultCallContextBuilder(),
7879
card_modifier=card_modifier,
7980
extended_card_modifier=extended_card_modifier,
8081
enable_v0_3_compat=enable_v0_3_compat,

src/a2a/server/routes/rest_routes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ def create_rest_routes( # noqa: PLR0913
7676
extended_agent_card: An optional, distinct AgentCard to be served
7777
at the authenticated extended card endpoint.
7878
context_builder: The CallContextBuilder used to construct the
79-
ServerCallContext passed to the request_handler. If None, no
80-
ServerCallContext is passed.
79+
ServerCallContext passed to the request_handler. If None the
80+
DefaultCallContextBuilder is used.
8181
card_modifier: An optional callback to dynamically modify the public
8282
agent card before it is served.
8383
extended_card_modifier: An optional callback to dynamically modify
@@ -100,7 +100,7 @@ def create_rest_routes( # noqa: PLR0913
100100
agent_card=agent_card,
101101
http_handler=request_handler,
102102
extended_agent_card=extended_agent_card,
103-
context_builder=context_builder,
103+
context_builder=context_builder or DefaultCallContextBuilder(),
104104
card_modifier=card_modifier,
105105
extended_card_modifier=extended_card_modifier,
106106
)

0 commit comments

Comments
 (0)