Skip to content

Commit 0d7a772

Browse files
google-genai-botcopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 906115416
1 parent ab5e328 commit 0d7a772

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

google/genai/_interactions/types/usage.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
__all__ = [
2424
"Usage",
2525
"CachedTokensByModality",
26+
"GroundingToolCount",
2627
"InputTokensByModality",
2728
"OutputTokensByModality",
2829
"ToolUseTokensByModality",
@@ -39,6 +40,16 @@ class CachedTokensByModality(BaseModel):
3940
"""Number of tokens for the modality."""
4041

4142

43+
class GroundingToolCount(BaseModel):
44+
"""The number of grounding tool counts."""
45+
46+
count: Optional[int] = None
47+
"""The number of grounding tool counts."""
48+
49+
type: Optional[Literal["google_search", "google_map", "your_data"]] = None
50+
"""The grounding tool type associated with the count."""
51+
52+
4253
class InputTokensByModality(BaseModel):
4354
"""The token count for a single response modality."""
4455

@@ -75,6 +86,9 @@ class Usage(BaseModel):
7586
cached_tokens_by_modality: Optional[List[CachedTokensByModality]] = None
7687
"""A breakdown of cached token usage by modality."""
7788

89+
grounding_tool_count: Optional[List[GroundingToolCount]] = None
90+
"""Grounding tool count."""
91+
7892
input_tokens_by_modality: Optional[List[InputTokensByModality]] = None
7993
"""A breakdown of input token usage by modality."""
8094

google/genai/_interactions/types/usage_param.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
__all__ = [
2424
"UsageParam",
2525
"CachedTokensByModality",
26+
"GroundingToolCount",
2627
"InputTokensByModality",
2728
"OutputTokensByModality",
2829
"ToolUseTokensByModality",
@@ -39,6 +40,16 @@ class CachedTokensByModality(TypedDict, total=False):
3940
"""Number of tokens for the modality."""
4041

4142

43+
class GroundingToolCount(TypedDict, total=False):
44+
"""The number of grounding tool counts."""
45+
46+
count: int
47+
"""The number of grounding tool counts."""
48+
49+
type: Literal["google_search", "google_map", "your_data"]
50+
"""The grounding tool type associated with the count."""
51+
52+
4253
class InputTokensByModality(TypedDict, total=False):
4354
"""The token count for a single response modality."""
4455

@@ -75,6 +86,9 @@ class UsageParam(TypedDict, total=False):
7586
cached_tokens_by_modality: Iterable[CachedTokensByModality]
7687
"""A breakdown of cached token usage by modality."""
7788

89+
grounding_tool_count: Iterable[GroundingToolCount]
90+
"""Grounding tool count."""
91+
7892
input_tokens_by_modality: Iterable[InputTokensByModality]
7993
"""A breakdown of input token usage by modality."""
8094

0 commit comments

Comments
 (0)