Skip to content

Commit 5c820f2

Browse files
Annhiluccopybara-github
authored andcommitted
feat: Support dedicated TextAnnotationDelta for streaming tool responses
PiperOrigin-RevId: 891895587
1 parent 7cc2acc commit 5c820f2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

google/genai/_interactions/types/content_delta.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"DeltaFileSearchResult",
6060
"DeltaFileSearchResultResult",
6161
"DeltaGoogleMapsResult",
62+
"DeltaTextAnnotation",
6263
]
6364

6465

@@ -67,9 +68,6 @@ class DeltaText(BaseModel):
6768

6869
type: Literal["text"]
6970

70-
annotations: Optional[List[Annotation]] = None
71-
"""Citation information for model-generated content."""
72-
7371

7472
class DeltaImage(BaseModel):
7573
type: Literal["image"]
@@ -362,6 +360,13 @@ class DeltaGoogleMapsResult(BaseModel):
362360
"""A signature hash for backend validation."""
363361

364362

363+
class DeltaTextAnnotation(BaseModel):
364+
type: Literal["text_annotation"]
365+
366+
annotations: Optional[List[Annotation]] = None
367+
"""Citation information for model-generated content."""
368+
369+
365370
Delta: TypeAlias = Annotated[
366371
Union[
367372
DeltaText,
@@ -385,6 +390,7 @@ class DeltaGoogleMapsResult(BaseModel):
385390
DeltaMCPServerToolResult,
386391
DeltaFileSearchResult,
387392
DeltaGoogleMapsResult,
393+
DeltaTextAnnotation,
388394
],
389395
PropertyInfo(discriminator="type"),
390396
]

0 commit comments

Comments
 (0)