Skip to content

Commit fd7dd8c

Browse files
committed
Fix missing changes
1 parent 4504f0f commit fd7dd8c

File tree

17 files changed

+111
-105
lines changed

17 files changed

+111
-105
lines changed

src/a2a/server/tasks/task_updater.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async def add_artifact( # noqa: PLR0913
112112
task_id=self.task_id,
113113
context_id=self.context_id,
114114
artifact=Artifact(
115-
artifactId=artifact_id,
115+
artifact_id=artifact_id,
116116
name=name,
117117
parts=parts,
118118
metadata=metadata,

src/a2a/utils/artifact.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ def new_artifact(
1818
description: An optional description of the artifact.
1919
2020
Returns:
21-
A new `Artifact` object with a generated artifactId.
21+
A new `Artifact` object with a generated artifact_id.
2222
"""
2323
return Artifact(
24-
artifactId=str(uuid.uuid4()),
24+
artifact_id=str(uuid.uuid4()),
2525
parts=parts,
2626
name=name,
2727
description=description,
@@ -41,7 +41,7 @@ def new_text_artifact(
4141
description: An optional description of the artifact.
4242
4343
Returns:
44-
A new `Artifact` object with a generated artifactId.
44+
A new `Artifact` object with a generated artifact_id.
4545
"""
4646
return new_artifact(
4747
[Part(root=TextPart(text=text))],
@@ -63,7 +63,7 @@ def new_data_artifact(
6363
description: An optional description of the artifact.
6464
6565
Returns:
66-
A new `Artifact` object with a generated artifactId.
66+
A new `Artifact` object with a generated artifact_id.
6767
"""
6868
return new_artifact(
6969
[Part(root=DataPart(data=data))],

src/a2a/utils/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def build_text_artifact(text: str, artifact_id: str) -> Artifact:
115115
"""
116116
text_part = TextPart(text=text)
117117
part = Part(root=text_part)
118-
return Artifact(parts=[part], artifactId=artifact_id)
118+
return Artifact(parts=[part], artifact_id=artifact_id)
119119

120120

121121
def validate(

src/a2a/utils/proto_utils.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def task_state(cls, state: a2a_pb2.TaskState) -> types.TaskState:
517517
@classmethod
518518
def artifact(cls, artifact: a2a_pb2.Artifact) -> types.Artifact:
519519
return types.Artifact(
520-
artifactId=artifact.artifact_id,
520+
artifact_id=artifact.artifact_id,
521521
description=artifact.description,
522522
metadata=FromProto.metadata(artifact.metadata),
523523
name=artifact.name,
@@ -577,12 +577,12 @@ def message_send_configuration(
577577
) -> types.MessageSendConfiguration:
578578
return types.MessageSendConfiguration(
579579
accepted_output_modes=list(config.accepted_output_modes),
580-
pushNotificationConfig=FromProto.push_notification_config(
580+
push_notification_config=FromProto.push_notification_config(
581581
config.push_notification
582582
)
583583
if config.HasField('push_notification')
584584
else None,
585-
historyLength=config.history_length,
585+
history_length=config.history_length,
586586
blocking=config.blocking,
587587
)
588588

@@ -638,7 +638,7 @@ def task_push_notification_config(
638638
)
639639
)
640640
return types.TaskPushNotificationConfig(
641-
pushNotificationConfig=cls.push_notification_config(
641+
push_notification_config=cls.push_notification_config(
642642
request.config.push_notification_config,
643643
),
644644
task_id=m.group(1),
@@ -651,18 +651,18 @@ def agent_card(
651651
) -> types.AgentCard:
652652
return types.AgentCard(
653653
capabilities=cls.capabilities(card.capabilities),
654-
defaultInputModes=list(card.default_input_modes),
655-
defaultOutputModes=list(card.default_output_modes),
654+
default_input_modes=list(card.default_input_modes),
655+
default_output_modes=list(card.default_output_modes),
656656
description=card.description,
657-
documentationUrl=card.documentation_url,
657+
documentation_url=card.documentation_url,
658658
name=card.name,
659659
provider=cls.provider(card.provider),
660660
security=cls.security(list(card.security)),
661-
securitySchemes=cls.security_schemes(dict(card.security_schemes)),
661+
security_schemes=cls.security_schemes(dict(card.security_schemes)),
662662
skills=[cls.skill(x) for x in card.skills] if card.skills else [],
663663
url=card.url,
664664
version=card.version,
665-
supportsAuthenticatedExtendedCard=card.supports_authenticated_extended_card,
665+
supports_authenticated_extended_card=card.supports_authenticated_extended_card,
666666
)
667667

668668
@classmethod
@@ -678,7 +678,7 @@ def task_query_params(
678678
)
679679
)
680680
return types.TaskQueryParams(
681-
historyLength=request.history_length
681+
history_length=request.history_length
682682
if request.history_length
683683
else None,
684684
id=m.group(1),
@@ -691,7 +691,7 @@ def capabilities(
691691
) -> types.AgentCapabilities:
692692
return types.AgentCapabilities(
693693
streaming=capabilities.streaming,
694-
pushNotifications=capabilities.push_notifications,
694+
push_notifications=capabilities.push_notifications,
695695
)
696696

697697
@classmethod
@@ -741,7 +741,7 @@ def security_scheme(
741741
root=types.HTTPAuthSecurityScheme(
742742
description=scheme.http_auth_security_scheme.description,
743743
scheme=scheme.http_auth_security_scheme.scheme,
744-
bearerFormat=scheme.http_auth_security_scheme.bearer_format,
744+
bearer_format=scheme.http_auth_security_scheme.bearer_format,
745745
)
746746
)
747747
if scheme.HasField('oauth2_security_scheme'):
@@ -754,42 +754,42 @@ def security_scheme(
754754
return types.SecurityScheme(
755755
root=types.OpenIdConnectSecurityScheme(
756756
description=scheme.open_id_connect_security_scheme.description,
757-
openIdConnectUrl=scheme.open_id_connect_security_scheme.open_id_connect_url,
757+
open_id_connect_url=scheme.open_id_connect_security_scheme.open_id_connect_url,
758758
)
759759
)
760760

761761
@classmethod
762762
def oauth2_flows(cls, flows: a2a_pb2.OAuthFlows) -> types.OAuthFlows:
763763
if flows.HasField('authorization_code'):
764764
return types.OAuthFlows(
765-
authorizationCode=types.AuthorizationCodeOAuthFlow(
766-
authorizationUrl=flows.authorization_code.authorization_url,
767-
refreshUrl=flows.authorization_code.refresh_url,
765+
authorization_code=types.AuthorizationCodeOAuthFlow(
766+
authorization_url=flows.authorization_code.authorization_url,
767+
refresh_url=flows.authorization_code.refresh_url,
768768
scopes=dict(flows.authorization_code.scopes.items()),
769-
tokenUrl=flows.authorization_code.token_url,
769+
token_url=flows.authorization_code.token_url,
770770
),
771771
)
772772
if flows.HasField('client_credentials'):
773773
return types.OAuthFlows(
774-
clientCredentials=types.ClientCredentialsOAuthFlow(
775-
refreshUrl=flows.client_credentials.refresh_url,
774+
client_credentials=types.ClientCredentialsOAuthFlow(
775+
refresh_url=flows.client_credentials.refresh_url,
776776
scopes=dict(flows.client_credentials.scopes.items()),
777-
tokenUrl=flows.client_credentials.token_url,
777+
token_url=flows.client_credentials.token_url,
778778
),
779779
)
780780
if flows.HasField('implicit'):
781781
return types.OAuthFlows(
782782
implicit=types.ImplicitOAuthFlow(
783-
authorizationUrl=flows.implicit.authorization_url,
784-
refreshUrl=flows.implicit.refresh_url,
783+
authorization_url=flows.implicit.authorization_url,
784+
refresh_url=flows.implicit.refresh_url,
785785
scopes=dict(flows.implicit.scopes.items()),
786786
),
787787
)
788788
return types.OAuthFlows(
789789
password=types.PasswordOAuthFlow(
790-
refreshUrl=flows.password.refresh_url,
790+
refresh_url=flows.password.refresh_url,
791791
scopes=dict(flows.password.scopes.items()),
792-
tokenUrl=flows.password.token_url,
792+
token_url=flows.password.token_url,
793793
),
794794
)
795795

tests/client/test_grpc_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ def sample_agent_card() -> AgentCard:
4343
description='Agent for testing gRPC client',
4444
url='grpc://localhost:50051',
4545
version='1.0',
46-
capabilities=AgentCapabilities(streaming=True, pushNotifications=True),
47-
defaultInputModes=['text/plain'],
48-
defaultOutputModes=['text/plain'],
46+
capabilities=AgentCapabilities(streaming=True, push_notifications=True),
47+
default_input_modes=['text/plain'],
48+
default_output_modes=['text/plain'],
4949
skills=[],
5050
)
5151

tests/server/apps/jsonrpc/test_serialization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def agent_card_with_api_key():
3838
url='http://example.com/apikey-agent',
3939
version='1.0.0',
4040
capabilities=AgentCapabilities(),
41-
defaultInputModes=['text/plain'],
42-
defaultOutputModes=['text/plain'],
41+
default_input_modes=['text/plain'],
42+
default_output_modes=['text/plain'],
4343
skills=[],
44-
securitySchemes={'api_key_auth': SecurityScheme(root=api_key_scheme)},
44+
security_schemes={'api_key_auth': SecurityScheme(root=api_key_scheme)},
4545
security=[{'api_key_auth': []}],
4646
)
4747
return agent_card

tests/server/events/test_event_consumer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async def test_consume_all_multiple_events(
131131
task_id='task_123',
132132
context_id='session-xyz',
133133
artifact=Artifact(
134-
artifactId='11', parts=[Part(TextPart(text='text'))]
134+
artifact_id='11', parts=[Part(TextPart(text='text'))]
135135
),
136136
),
137137
TaskStatusUpdateEvent(
@@ -173,7 +173,7 @@ async def test_consume_until_message(
173173
task_id='task_123',
174174
context_id='session-xyz',
175175
artifact=Artifact(
176-
artifactId='11', parts=[Part(TextPart(text='text'))]
176+
artifact_id='11', parts=[Part(TextPart(text='text'))]
177177
),
178178
),
179179
Message(**MESSAGE_PAYLOAD),

tests/server/events/test_event_queue.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ async def test_task_done(event_queue: EventQueue) -> None:
116116
event = TaskArtifactUpdateEvent(
117117
task_id='task_123',
118118
context_id='session-xyz',
119-
artifact=Artifact(artifactId='11', parts=[Part(TextPart(text='text'))]),
119+
artifact=Artifact(
120+
artifact_id='11', parts=[Part(TextPart(text='text'))]
121+
),
120122
)
121123
await event_queue.enqueue_event(event)
122124
_ = await event_queue.dequeue_event()

tests/server/request_handlers/test_default_request_handler.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ async def test_on_message_send_with_push_notification():
343343

344344
push_config = PushNotificationConfig(url='http://callback.com/push')
345345
message_config = MessageSendConfiguration(
346-
pushNotificationConfig=push_config,
346+
push_notification_config=push_config,
347347
accepted_output_modes=['text/plain'], # Added required field
348348
)
349349
params = MessageSendParams(
@@ -431,7 +431,7 @@ async def test_on_message_send_with_push_notification_no_existing_Task():
431431

432432
push_config = PushNotificationConfig(url='http://callback.com/push')
433433
message_config = MessageSendConfiguration(
434-
pushNotificationConfig=push_config,
434+
push_notification_config=push_config,
435435
accepted_output_modes=['text/plain'], # Added required field
436436
)
437437
params = MessageSendParams(
@@ -685,7 +685,7 @@ async def test_on_message_send_stream_with_push_notification():
685685

686686
push_config = PushNotificationConfig(url='http://callback.stream.com/push')
687687
message_config = MessageSendConfiguration(
688-
pushNotificationConfig=push_config,
688+
push_notification_config=push_config,
689689
accepted_output_modes=['text/plain'], # Added required field
690690
)
691691
params = MessageSendParams(
@@ -1032,7 +1032,9 @@ async def test_set_task_push_notification_config_no_notifier():
10321032
)
10331033
params = TaskPushNotificationConfig(
10341034
task_id='task1',
1035-
pushNotificationConfig=PushNotificationConfig(url='http://example.com'),
1035+
push_notification_config=PushNotificationConfig(
1036+
url='http://example.com'
1037+
),
10361038
)
10371039
from a2a.utils.errors import ServerError # Local import
10381040

@@ -1059,7 +1061,9 @@ async def test_set_task_push_notification_config_task_not_found():
10591061
)
10601062
params = TaskPushNotificationConfig(
10611063
task_id='non_existent_task',
1062-
pushNotificationConfig=PushNotificationConfig(url='http://example.com'),
1064+
push_notification_config=PushNotificationConfig(
1065+
url='http://example.com'
1066+
),
10631067
)
10641068
from a2a.utils.errors import ServerError # Local import
10651069

@@ -1162,7 +1166,7 @@ async def test_get_task_push_notification_config_info_with_config():
11621166

11631167
set_config_params = TaskPushNotificationConfig(
11641168
task_id='task_1',
1165-
pushNotificationConfig=PushNotificationConfig(
1169+
push_notification_config=PushNotificationConfig(
11661170
id='config_id', url='http://1.example.com'
11671171
),
11681172
)
@@ -1171,7 +1175,7 @@ async def test_get_task_push_notification_config_info_with_config():
11711175
)
11721176

11731177
params = GetTaskPushNotificationConfigParams(
1174-
id='task_1', pushNotificationConfigId='config_id'
1178+
id='task_1', push_notification_config_id='config_id'
11751179
)
11761180

11771181
result: TaskPushNotificationConfig = (
@@ -1487,7 +1491,7 @@ async def test_delete_task_push_notification_config_no_store():
14871491
push_config_store=None, # Explicitly None
14881492
)
14891493
params = DeleteTaskPushNotificationConfigParams(
1490-
id='task1', pushNotificationConfigId='config1'
1494+
id='task1', push_notification_config_id='config1'
14911495
)
14921496
from a2a.utils.errors import ServerError # Local import
14931497

@@ -1511,7 +1515,7 @@ async def test_delete_task_push_notification_config_task_not_found():
15111515
push_config_store=mock_push_store,
15121516
)
15131517
params = DeleteTaskPushNotificationConfigParams(
1514-
id='non_existent_task', pushNotificationConfigId='config1'
1518+
id='non_existent_task', push_notification_config_id='config1'
15151519
)
15161520
from a2a.utils.errors import ServerError # Local import
15171521

@@ -1545,7 +1549,7 @@ async def test_delete_no_task_push_notification_config_info():
15451549
push_config_store=push_store,
15461550
)
15471551
params = DeleteTaskPushNotificationConfigParams(
1548-
id='task1', pushNotificationConfigId='config_non_existant'
1552+
id='task1', push_notification_config_id='config_non_existant'
15491553
)
15501554

15511555
result = await request_handler.on_delete_task_push_notification_config(
@@ -1554,7 +1558,7 @@ async def test_delete_no_task_push_notification_config_info():
15541558
assert result == None
15551559

15561560
params = DeleteTaskPushNotificationConfigParams(
1557-
id='task2', pushNotificationConfigId='config_non_existant'
1561+
id='task2', push_notification_config_id='config_non_existant'
15581562
)
15591563

15601564
result = await request_handler.on_delete_task_push_notification_config(
@@ -1589,7 +1593,7 @@ async def test_delete_task_push_notification_config_info_with_config():
15891593
push_config_store=push_store,
15901594
)
15911595
params = DeleteTaskPushNotificationConfigParams(
1592-
id='task_1', pushNotificationConfigId='config_1'
1596+
id='task_1', push_notification_config_id='config_1'
15931597
)
15941598

15951599
result1 = await request_handler.on_delete_task_push_notification_config(
@@ -1629,7 +1633,7 @@ async def test_delete_task_push_notification_config_info_with_config_and_no_id()
16291633
push_config_store=push_store,
16301634
)
16311635
params = DeleteTaskPushNotificationConfigParams(
1632-
id='task_1', pushNotificationConfigId='task_1'
1636+
id='task_1', push_notification_config_id='task_1'
16331637
)
16341638

16351639
result = await request_handler.on_delete_task_push_notification_config(

tests/server/request_handlers/test_grpc_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ def sample_agent_card() -> types.AgentCard:
3232
url='http://localhost',
3333
version='1.0.0',
3434
capabilities=types.AgentCapabilities(
35-
streaming=True, pushNotifications=True
35+
streaming=True, push_notifications=True
3636
),
37-
defaultInputModes=['text/plain'],
38-
defaultOutputModes=['text/plain'],
37+
default_input_modes=['text/plain'],
38+
default_output_modes=['text/plain'],
3939
skills=[],
4040
)
4141

0 commit comments

Comments
 (0)