Skip to content

Commit aed1559

Browse files
Annhiluccopybara-github
authored andcommitted
feat: Add custom_metadata to FileSearchResult.
PiperOrigin-RevId: 889406824
1 parent 8ec977c commit aed1559

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

google/genai/_interactions/types/content_delta.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"DeltaMCPServerToolResult",
5858
"DeltaMCPServerToolResultResultFunctionResultSubcontentList",
5959
"DeltaFileSearchResult",
60+
"DeltaFileSearchResultResult",
6061
"DeltaGoogleMapsResult",
6162
]
6263

@@ -337,11 +338,18 @@ class DeltaMCPServerToolResult(BaseModel):
337338
"""A signature hash for backend validation."""
338339

339340

341+
class DeltaFileSearchResultResult(BaseModel):
342+
"""The result of the File Search."""
343+
344+
custom_metadata: Optional[List[object]] = None
345+
"""User provided metadata about the FileSearchResult."""
346+
347+
340348
class DeltaFileSearchResult(BaseModel):
341349
call_id: str
342350
"""ID to match the ID from the function call block."""
343351

344-
result: List[object]
352+
result: List[DeltaFileSearchResultResult]
345353

346354
type: Literal["file_search_result"]
347355

google/genai/_interactions/types/file_search_result_content.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020

2121
from .._models import BaseModel
2222

23-
__all__ = ["FileSearchResultContent"]
23+
__all__ = ["FileSearchResultContent", "Result"]
24+
25+
26+
class Result(BaseModel):
27+
"""The result of the File Search."""
28+
29+
custom_metadata: Optional[List[object]] = None
30+
"""User provided metadata about the FileSearchResult."""
2431

2532

2633
class FileSearchResultContent(BaseModel):
@@ -29,7 +36,7 @@ class FileSearchResultContent(BaseModel):
2936
call_id: str
3037
"""ID to match the ID from the file search call block."""
3138

32-
result: List[object]
39+
result: List[Result]
3340
"""Required. The results of the File Search."""
3441

3542
type: Literal["file_search_result"]

google/genai/_interactions/types/file_search_result_content_param.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424
from .._utils import PropertyInfo
2525
from .._models import set_pydantic_config
2626

27-
__all__ = ["FileSearchResultContentParam"]
27+
__all__ = ["FileSearchResultContentParam", "Result"]
28+
29+
30+
class Result(TypedDict, total=False):
31+
"""The result of the File Search."""
32+
33+
custom_metadata: Iterable[object]
34+
"""User provided metadata about the FileSearchResult."""
2835

2936

3037
class FileSearchResultContentParam(TypedDict, total=False):
@@ -33,7 +40,7 @@ class FileSearchResultContentParam(TypedDict, total=False):
3340
call_id: Required[str]
3441
"""ID to match the ID from the file search call block."""
3542

36-
result: Required[Iterable[object]]
43+
result: Required[Iterable[Result]]
3744
"""Required. The results of the File Search."""
3845

3946
type: Required[Literal["file_search_result"]]

0 commit comments

Comments
 (0)