@@ -185,6 +185,9 @@ class Citation(TypedDict):
185
185
# is difficult to reliably extract spans from the raw document text across file
186
186
# formats or encoding schemes.
187
187
188
+ extras : NotRequired [dict [str , Any ]]
189
+ """Provider-specific metadata."""
190
+
188
191
189
192
class NonStandardAnnotation (TypedDict ):
190
193
"""Provider-specific annotation format."""
@@ -240,6 +243,9 @@ class TextContentBlock(TypedDict):
240
243
index : NotRequired [int ]
241
244
"""Index of block in aggregate response. Used during streaming."""
242
245
246
+ extras : NotRequired [dict [str , Any ]]
247
+ """Provider-specific metadata."""
248
+
243
249
244
250
class ToolCall (TypedDict ):
245
251
"""Represents a request to call a tool.
@@ -286,6 +292,9 @@ class ToolCall(TypedDict):
286
292
index : NotRequired [int ]
287
293
"""Index of block in aggregate response. Used during streaming."""
288
294
295
+ extras : NotRequired [dict [str , Any ]]
296
+ """Provider-specific metadata."""
297
+
289
298
290
299
class ToolCallChunk (TypedDict ):
291
300
"""A chunk of a tool call (e.g., as part of a stream).
@@ -324,6 +333,9 @@ class ToolCallChunk(TypedDict):
324
333
index : Optional [int ]
325
334
"""The index of the tool call in a sequence."""
326
335
336
+ extras : NotRequired [dict [str , Any ]]
337
+ """Provider-specific metadata."""
338
+
327
339
328
340
class InvalidToolCall (TypedDict ):
329
341
"""Allowance for errors made by LLM.
@@ -349,6 +361,9 @@ class InvalidToolCall(TypedDict):
349
361
error : Optional [str ]
350
362
"""An error message associated with the tool call."""
351
363
364
+ extras : NotRequired [dict [str , Any ]]
365
+ """Provider-specific metadata."""
366
+
352
367
353
368
# Note: These are not standard tool calls, but rather provider-specific built-in tools.
354
369
# Web search
@@ -371,6 +386,9 @@ class WebSearchCall(TypedDict):
371
386
index : NotRequired [int ]
372
387
"""Index of block in aggregate response. Used during streaming."""
373
388
389
+ extras : NotRequired [dict [str , Any ]]
390
+ """Provider-specific metadata."""
391
+
374
392
375
393
class WebSearchResult (TypedDict ):
376
394
"""Result of a built-in web search tool call."""
@@ -391,6 +409,9 @@ class WebSearchResult(TypedDict):
391
409
index : NotRequired [int ]
392
410
"""Index of block in aggregate response. Used during streaming."""
393
411
412
+ extras : NotRequired [dict [str , Any ]]
413
+ """Provider-specific metadata."""
414
+
394
415
395
416
class CodeInterpreterCall (TypedDict ):
396
417
"""Built-in code interpreter tool call."""
@@ -414,6 +435,9 @@ class CodeInterpreterCall(TypedDict):
414
435
index : NotRequired [int ]
415
436
"""Index of block in aggregate response. Used during streaming."""
416
437
438
+ extras : NotRequired [dict [str , Any ]]
439
+ """Provider-specific metadata."""
440
+
417
441
418
442
class CodeInterpreterOutput (TypedDict ):
419
443
"""Output of a singular code interpreter tool call.
@@ -450,6 +474,9 @@ class CodeInterpreterOutput(TypedDict):
450
474
index : NotRequired [int ]
451
475
"""Index of block in aggregate response. Used during streaming."""
452
476
477
+ extras : NotRequired [dict [str , Any ]]
478
+ """Provider-specific metadata."""
479
+
453
480
454
481
class CodeInterpreterResult (TypedDict ):
455
482
"""Result of a code interpreter tool call."""
@@ -470,6 +497,9 @@ class CodeInterpreterResult(TypedDict):
470
497
index : NotRequired [int ]
471
498
"""Index of block in aggregate response. Used during streaming."""
472
499
500
+ extras : NotRequired [dict [str , Any ]]
501
+ """Provider-specific metadata."""
502
+
473
503
474
504
class ReasoningContentBlock (TypedDict ):
475
505
"""Reasoning output from a LLM.
@@ -503,6 +533,9 @@ class ReasoningContentBlock(TypedDict):
503
533
index : NotRequired [int ]
504
534
"""Index of block in aggregate response. Used during streaming."""
505
535
536
+ extras : NotRequired [dict [str , Any ]]
537
+ """Provider-specific metadata."""
538
+
506
539
507
540
# Note: `title` and `context` are fields that could be used to provide additional
508
541
# information about the file, such as a description or summary of its content.
@@ -547,11 +580,8 @@ class ImageContentBlock(TypedDict):
547
580
base64 : NotRequired [str ]
548
581
"""Data as a base64 string."""
549
582
550
- # title: NotRequired[str]
551
- # """Title of the image."""
552
-
553
- # context: NotRequired[str]
554
- # """Context for the image, e.g., a description or summary of the image's content.""" # noqa: E501
583
+ extras : NotRequired [dict [str , Any ]]
584
+ """Provider-specific metadata."""
555
585
556
586
557
587
class VideoContentBlock (TypedDict ):
@@ -594,11 +624,8 @@ class VideoContentBlock(TypedDict):
594
624
base64 : NotRequired [str ]
595
625
"""Data as a base64 string."""
596
626
597
- # title: NotRequired[str]
598
- # """Title of the video."""
599
-
600
- # context: NotRequired[str]
601
- # """Context for the video, e.g., description or summary of the video's content."""
627
+ extras : NotRequired [dict [str , Any ]]
628
+ """Provider-specific metadata."""
602
629
603
630
604
631
class AudioContentBlock (TypedDict ):
@@ -641,11 +668,8 @@ class AudioContentBlock(TypedDict):
641
668
base64 : NotRequired [str ]
642
669
"""Data as a base64 string."""
643
670
644
- # title: NotRequired[str]
645
- # """Title of the audio."""
646
-
647
- # context: NotRequired[str]
648
- # """Context for the audio, e.g., description or summary of the audio's content."""
671
+ extras : NotRequired [dict [str , Any ]]
672
+ """Provider-specific metadata."""
649
673
650
674
651
675
class PlainTextContentBlock (TypedDict ):
@@ -698,6 +722,9 @@ class PlainTextContentBlock(TypedDict):
698
722
context : NotRequired [str ]
699
723
"""Context for the text, e.g., a description or summary of the text's content."""
700
724
725
+ extras : NotRequired [dict [str , Any ]]
726
+ """Provider-specific metadata."""
727
+
701
728
702
729
class FileContentBlock (TypedDict ):
703
730
"""File data that doesn't fit into other multimodal blocks.
@@ -746,11 +773,8 @@ class FileContentBlock(TypedDict):
746
773
base64 : NotRequired [str ]
747
774
"""Data as a base64 string."""
748
775
749
- # title: NotRequired[str]
750
- # """Title of the file, e.g., the name of a document or file."""
751
-
752
- # context: NotRequired[str]
753
- # """Context for the file, e.g., a description or summary of the file's content."""
776
+ extras : NotRequired [dict [str , Any ]]
777
+ """Provider-specific metadata."""
754
778
755
779
756
780
# Future modalities to consider:
0 commit comments