106106 'version' : '1.0' ,
107107}
108108
109- TEXT_PART_DATA : dict [str , Any ] = {'itemType ' : 'text' , 'text' : 'Hello' }
109+ TEXT_PART_DATA : dict [str , Any ] = {'kind ' : 'text' , 'text' : 'Hello' }
110110FILE_URI_PART_DATA : dict [str , Any ] = {
111- 'itemType ' : 'file' ,
111+ 'kind ' : 'file' ,
112112 'file' : {'uri' : 'file:///path/to/file.txt' , 'mimeType' : 'text/plain' },
113113}
114114FILE_BYTES_PART_DATA : dict [str , Any ] = {
115- 'itemType ' : 'file' ,
115+ 'kind ' : 'file' ,
116116 'file' : {'bytes' : 'aGVsbG8=' , 'name' : 'hello.txt' }, # base64 for "hello"
117117}
118- DATA_PART_DATA : dict [str , Any ] = {'itemType ' : 'data' , 'data' : {'key' : 'value' }}
118+ DATA_PART_DATA : dict [str , Any ] = {'kind ' : 'data' , 'data' : {'key' : 'value' }}
119119
120120MINIMAL_MESSAGE_USER : dict [str , Any ] = {
121121 'role' : 'user' ,
122122 'parts' : [TEXT_PART_DATA ],
123123 'messageId' : 'msg-123' ,
124- 'itemType ' : 'message' ,
124+ 'kind ' : 'message' ,
125125}
126126
127127AGENT_MESSAGE_WITH_FILE : dict [str , Any ] = {
142142 'id' : 'task-abc' ,
143143 'contextId' : 'session-xyz' ,
144144 'status' : MINIMAL_TASK_STATUS ,
145- 'itemType ' : 'task' ,
145+ 'kind ' : 'task' ,
146146}
147147FULL_TASK : dict [str , Any ] = {
148148 'id' : 'task-abc' ,
157157 }
158158 ],
159159 'metadata' : {'priority' : 'high' },
160- 'itemType ' : 'task' ,
160+ 'kind ' : 'task' ,
161161}
162162
163163MINIMAL_TASK_ID_PARAMS : dict [str , Any ] = {'id' : 'task-123' }
@@ -269,15 +269,15 @@ def test_agent_card_invalid():
269269
270270def test_text_part ():
271271 part = TextPart (** TEXT_PART_DATA )
272- assert part .itemType == 'text'
272+ assert part .kind == 'text'
273273 assert part .text == 'Hello'
274274 assert part .metadata is None
275275
276276 with pytest .raises (ValidationError ):
277277 TextPart (type = 'text' ) # Missing text # type: ignore
278278 with pytest .raises (ValidationError ):
279279 TextPart (
280- itemType = 'file' , # type: ignore
280+ kind = 'file' , # type: ignore
281281 text = 'hello' ,
282282 ) # Wrong type literal
283283
@@ -287,15 +287,15 @@ def test_file_part_variants():
287287 file_uri = FileWithUri (
288288 uri = 'file:///path/to/file.txt' , mimeType = 'text/plain'
289289 )
290- part_uri = FilePart (itemType = 'file' , file = file_uri )
290+ part_uri = FilePart (kind = 'file' , file = file_uri )
291291 assert isinstance (part_uri .file , FileWithUri )
292292 assert part_uri .file .uri == 'file:///path/to/file.txt'
293293 assert part_uri .file .mimeType == 'text/plain'
294294 assert not hasattr (part_uri .file , 'bytes' )
295295
296296 # Bytes variant
297297 file_bytes = FileWithBytes (bytes = 'aGVsbG8=' , name = 'hello.txt' )
298- part_bytes = FilePart (itemType = 'file' , file = file_bytes )
298+ part_bytes = FilePart (kind = 'file' , file = file_bytes )
299299 assert isinstance (part_bytes .file , FileWithBytes )
300300 assert part_bytes .file .bytes == 'aGVsbG8='
301301 assert part_bytes .file .name == 'hello.txt'
@@ -312,14 +312,14 @@ def test_file_part_variants():
312312
313313 # Invalid - wrong type literal
314314 with pytest .raises (ValidationError ):
315- FilePart (itemType = 'text' , file = file_uri ) # type: ignore
315+ FilePart (kind = 'text' , file = file_uri ) # type: ignore
316316
317317 FilePart (** FILE_URI_PART_DATA , extra = 'extra' ) # type: ignore
318318
319319
320320def test_data_part ():
321321 part = DataPart (** DATA_PART_DATA )
322- assert part .itemType == 'data'
322+ assert part .kind == 'data'
323323 assert part .data == {'key' : 'value' }
324324
325325 with pytest .raises (ValidationError ):
@@ -656,7 +656,7 @@ def test_send_message_streaming_status_update_response() -> None:
656656 'taskId' : '1' ,
657657 'contextId' : '2' ,
658658 'final' : False ,
659- 'itemType ' : 'status-update' ,
659+ 'kind ' : 'status-update' ,
660660 }
661661
662662 event_data : dict [str , Any ] = {
@@ -716,7 +716,7 @@ def test_send_message_streaming_artifact_update_response() -> None:
716716 'contextId' : '2' ,
717717 'append' : False ,
718718 'lastChunk' : True ,
719- 'itemType ' : 'artifact-update' ,
719+ 'kind ' : 'artifact-update' ,
720720 }
721721 event_data : dict [str , Any ] = {
722722 'jsonrpc' : '2.0' ,
0 commit comments