Skip to content

Commit c1b6360

Browse files
committed
all tck test passes
1 parent 702616f commit c1b6360

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/a2a/types.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from enum import Enum
77
from typing import Any, Literal
88

9-
from pydantic import Field, RootModel, field_validator
9+
from pydantic import Field, RootModel, field_validator, model_validator
1010

1111
from a2a._base import A2ABaseModel
1212

@@ -1338,6 +1338,13 @@ class Part(RootModel[TextPart | FilePart | DataPart]):
13381338
be text, a file, or structured data.
13391339
"""
13401340

1341+
@model_validator(mode='before')
1342+
@classmethod
1343+
def validate_kind_present(cls, data: Any) -> Any:
1344+
if isinstance(data, dict) and 'kind' not in data:
1345+
raise ValueError("Message part must have a 'kind' field")
1346+
return data
1347+
13411348

13421349
class SetTaskPushNotificationConfigRequest(A2ABaseModel):
13431350
"""

0 commit comments

Comments
 (0)