Skip to content

Commit 97d6fe5

Browse files
IvanLHcopybara-github
authored andcommitted
feat: Introduce Server Side tools deltas
PiperOrigin-RevId: 913995290
1 parent 2d5e0fa commit 97d6fe5

9 files changed

Lines changed: 417 additions & 1 deletion

google/genai/_interactions/types/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@
5757
from .generation_config import GenerationConfig as GenerationConfig
5858
from .model_output_step import ModelOutputStep as ModelOutputStep
5959
from .function_call_step import FunctionCallStep as FunctionCallStep
60+
from .google_maps_result import GoogleMapsResult as GoogleMapsResult
6061
from .image_config_param import ImageConfigParam as ImageConfigParam
6162
from .text_content_param import TextContentParam as TextContentParam
6263
from .thought_step_param import ThoughtStepParam as ThoughtStepParam
6364
from .tool_choice_config import ToolChoiceConfig as ToolChoiceConfig
6465
from .url_citation_param import URLCitationParam as URLCitationParam
66+
from .url_context_result import URLContextResult as URLContextResult
6567
from .allowed_tools_param import AllowedToolsParam as AllowedToolsParam
6668
from .audio_content_param import AudioContentParam as AudioContentParam
6769
from .file_citation_param import FileCitationParam as FileCitationParam
@@ -72,6 +74,7 @@
7274
from .webhook_ping_params import WebhookPingParams as WebhookPingParams
7375
from .dynamic_agent_config import DynamicAgentConfig as DynamicAgentConfig
7476
from .function_result_step import FunctionResultStep as FunctionResultStep
77+
from .google_search_result import GoogleSearchResult as GoogleSearchResult
7578
from .place_citation_param import PlaceCitationParam as PlaceCitationParam
7679
from .text_response_format import TextResponseFormat as TextResponseFormat
7780
from .webhook_config_param import WebhookConfigParam as WebhookConfigParam
@@ -108,7 +111,9 @@
108111
from .deep_research_agent_config import DeepResearchAgentConfig as DeepResearchAgentConfig
109112
from .dynamic_agent_config_param import DynamicAgentConfigParam as DynamicAgentConfigParam
110113
from .function_result_step_param import FunctionResultStepParam as FunctionResultStepParam
114+
from .google_maps_call_arguments import GoogleMapsCallArguments as GoogleMapsCallArguments
111115
from .text_response_format_param import TextResponseFormatParam as TextResponseFormatParam
116+
from .url_context_call_arguments import URLContextCallArguments as URLContextCallArguments
112117
from .audio_response_format_param import AudioResponseFormatParam as AudioResponseFormatParam
113118
from .file_search_call_step_param import FileSearchCallStepParam as FileSearchCallStepParam
114119
from .google_maps_call_step_param import GoogleMapsCallStepParam as GoogleMapsCallStepParam
@@ -117,6 +122,8 @@
117122
from .mcp_server_tool_result_step import MCPServerToolResultStep as MCPServerToolResultStep
118123
from .url_context_call_step_param import URLContextCallStepParam as URLContextCallStepParam
119124
from .video_response_format_param import VideoResponseFormatParam as VideoResponseFormatParam
125+
from .google_search_call_arguments import GoogleSearchCallArguments as GoogleSearchCallArguments
126+
from .code_execution_call_arguments import CodeExecutionCallArguments as CodeExecutionCallArguments
120127
from .file_search_result_step_param import FileSearchResultStepParam as FileSearchResultStepParam
121128
from .google_maps_result_step_param import GoogleMapsResultStepParam as GoogleMapsResultStepParam
122129
from .google_search_call_step_param import GoogleSearchCallStepParam as GoogleSearchCallStepParam
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
17+
18+
from typing import Optional
19+
from typing_extensions import Literal
20+
21+
from .._models import BaseModel
22+
23+
__all__ = ["CodeExecutionCallArguments"]
24+
25+
26+
class CodeExecutionCallArguments(BaseModel):
27+
"""The arguments to pass to the code execution."""
28+
29+
code: Optional[str] = None
30+
"""The code to be executed."""
31+
32+
language: Optional[Literal["python"]] = None
33+
"""Programming language of the `code`."""
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
17+
18+
from typing import List, Optional
19+
20+
from .._models import BaseModel
21+
22+
__all__ = ["GoogleMapsCallArguments"]
23+
24+
25+
class GoogleMapsCallArguments(BaseModel):
26+
"""The arguments to pass to the Google Maps tool."""
27+
28+
queries: Optional[List[str]] = None
29+
"""The queries to be executed."""
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
17+
18+
from typing import List, Optional
19+
20+
from .._models import BaseModel
21+
22+
__all__ = ["GoogleMapsResult", "Place", "PlaceReviewSnippet"]
23+
24+
25+
class PlaceReviewSnippet(BaseModel):
26+
"""
27+
Encapsulates a snippet of a user review that answers a question about
28+
the features of a specific place in Google Maps.
29+
"""
30+
31+
review_id: Optional[str] = None
32+
"""The ID of the review snippet."""
33+
34+
title: Optional[str] = None
35+
"""Title of the review."""
36+
37+
url: Optional[str] = None
38+
"""A link that corresponds to the user review on Google Maps."""
39+
40+
41+
class Place(BaseModel):
42+
name: Optional[str] = None
43+
"""Title of the place."""
44+
45+
place_id: Optional[str] = None
46+
"""The ID of the place, in `places/{place_id}` format."""
47+
48+
review_snippets: Optional[List[PlaceReviewSnippet]] = None
49+
"""
50+
Snippets of reviews that are used to generate answers about the features of a
51+
given place in Google Maps.
52+
"""
53+
54+
url: Optional[str] = None
55+
"""URI reference of the place."""
56+
57+
58+
class GoogleMapsResult(BaseModel):
59+
"""The result of the Google Maps."""
60+
61+
places: Optional[List[Place]] = None
62+
"""The places that were found."""
63+
64+
widget_context_token: Optional[str] = None
65+
"""Resource name of the Google Maps widget context token."""
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
17+
18+
from typing import List, Optional
19+
20+
from .._models import BaseModel
21+
22+
__all__ = ["GoogleSearchCallArguments"]
23+
24+
25+
class GoogleSearchCallArguments(BaseModel):
26+
"""The arguments to pass to Google Search."""
27+
28+
queries: Optional[List[str]] = None
29+
"""Web search queries for the following-up web search."""
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
17+
18+
from typing import Optional
19+
20+
from .._models import BaseModel
21+
22+
__all__ = ["GoogleSearchResult"]
23+
24+
25+
class GoogleSearchResult(BaseModel):
26+
"""The result of the Google Search."""
27+
28+
search_suggestions: Optional[str] = None
29+
"""Web content snippet that can be embedded in a web page or an app webview."""

0 commit comments

Comments
 (0)