Skip to content

Commit 06eea85

Browse files
google-genai-botcopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 930640671
1 parent f8f9749 commit 06eea85

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

google/genai/models.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6476,7 +6476,9 @@ def generate_content(
64766476
response = types.GenerateContentResponse()
64776477
i = 0
64786478
while remaining_remote_calls_afc > 0:
6479-
parsed_config_to_call = parsed_config.copy() if parsed_config else None
6479+
parsed_config_to_call = (
6480+
parsed_config.model_copy() if parsed_config else None
6481+
)
64806482
function_map = _extra_utils.get_function_map(parsed_config)
64816483
if function_map:
64826484
parsed_config_to_call = _extra_utils.get_usage_header(
@@ -6649,7 +6651,9 @@ def generate_content_stream(
66496651
func_response_parts = None
66506652
i = 0
66516653
while remaining_remote_calls_afc > 0:
6652-
parsed_config_to_call = parsed_config.copy() if parsed_config else None
6654+
parsed_config_to_call = (
6655+
parsed_config.model_copy() if parsed_config else None
6656+
)
66536657
function_map = _extra_utils.get_function_map(parsed_config)
66546658
if function_map:
66556659
parsed_config_to_call = _extra_utils.get_usage_header(
@@ -7040,7 +7044,7 @@ def list(
70407044
if config.query_base is None:
70417045
config.query_base = True
70427046
if self._api_client.vertexai:
7043-
config = config.copy()
7047+
config = config.model_copy()
70447048
if not config.query_base:
70457049
# Filter for tuning jobs artifacts by labels.
70467050
filter_value = config.filter
@@ -8654,7 +8658,9 @@ async def generate_content(
86548658
is_caller_method_async=True,
86558659
)
86568660
final_parsed_config_to_call = (
8657-
final_parsed_config.copy() if final_parsed_config else None
8661+
final_parsed_config.model_copy()
8662+
if final_parsed_config
8663+
else None
86588664
)
86598665
if function_map:
86608666
final_parsed_config_to_call = _extra_utils.get_usage_header(
@@ -8853,7 +8859,7 @@ async def async_generator(model, contents, config): # type: ignore[no-untyped-d
88538859
function_map = _extra_utils.get_function_map(
88548860
config, mcp_to_genai_tool_adapters, is_caller_method_async=True
88558861
)
8856-
config_to_call = config.copy() if config else None
8862+
config_to_call = config.model_copy() if config else None
88578863
if function_map:
88588864
config_to_call = _extra_utils.get_usage_header(config_to_call)
88598865
i += 1
@@ -9033,7 +9039,7 @@ async def list(
90339039
if config.query_base is None:
90349040
config.query_base = True
90359041
if self._api_client.vertexai:
9036-
config = config.copy()
9042+
config = config.model_copy()
90379043
if not config.query_base:
90389044
# Filter for tuning jobs artifacts by labels.
90399045
filter_value = config.filter

0 commit comments

Comments
 (0)