google-genai 1.56.0__tar.gz → 1.57.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {google_genai-1.56.0/google_genai.egg-info → google_genai-1.57.0}/PKG-INFO +2 -2
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_api_client.py +37 -18
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_base_client.py +1 -1
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/__init__.py +2 -0
- google_genai-1.56.0/google/genai/_interactions/types/turn.py → google_genai-1.57.0/google/genai/_interactions/types/content.py +3 -16
- google_genai-1.56.0/google/genai/_interactions/types/turn_param.py → google_genai-1.57.0/google/genai/_interactions/types/content_param.py +4 -16
- google_genai-1.57.0/google/genai/_interactions/types/content_start.py +39 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/interaction.py +4 -52
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/interaction_create_params.py +2 -22
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/model.py +1 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/model_param.py +1 -0
- google_genai-1.57.0/google/genai/_interactions/types/turn.py +35 -0
- google_genai-1.57.0/google/genai/_interactions/types/turn_param.py +37 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/usage.py +1 -1
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/usage_param.py +1 -1
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_local_tokenizer_loader.py +1 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/batches.py +27 -22
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/chats.py +0 -2
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/files.py +224 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/models.py +56 -44
- google_genai-1.57.0/google/genai/tests/__init__.py +21 -0
- google_genai-1.57.0/google/genai/tests/afc/__init__.py +21 -0
- google_genai-1.57.0/google/genai/tests/afc/test_convert_if_exist_pydantic_model.py +309 -0
- google_genai-1.57.0/google/genai/tests/afc/test_convert_number_values_for_function_call_args.py +63 -0
- google_genai-1.57.0/google/genai/tests/afc/test_find_afc_incompatible_tool_indexes.py +240 -0
- google_genai-1.57.0/google/genai/tests/afc/test_generate_content_stream_afc.py +530 -0
- google_genai-1.57.0/google/genai/tests/afc/test_generate_content_stream_afc_thoughts.py +77 -0
- google_genai-1.57.0/google/genai/tests/afc/test_get_function_map.py +176 -0
- google_genai-1.57.0/google/genai/tests/afc/test_get_function_response_parts.py +277 -0
- google_genai-1.57.0/google/genai/tests/afc/test_get_max_remote_calls_for_afc.py +130 -0
- google_genai-1.57.0/google/genai/tests/afc/test_invoke_function_from_dict_args.py +241 -0
- google_genai-1.57.0/google/genai/tests/afc/test_raise_error_for_afc_incompatible_config.py +159 -0
- google_genai-1.57.0/google/genai/tests/afc/test_should_append_afc_history.py +53 -0
- google_genai-1.57.0/google/genai/tests/afc/test_should_disable_afc.py +214 -0
- google_genai-1.57.0/google/genai/tests/batches/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/batches/test_cancel.py +77 -0
- google_genai-1.57.0/google/genai/tests/batches/test_create.py +78 -0
- google_genai-1.57.0/google/genai/tests/batches/test_create_with_bigquery.py +113 -0
- google_genai-1.57.0/google/genai/tests/batches/test_create_with_file.py +82 -0
- google_genai-1.57.0/google/genai/tests/batches/test_create_with_gcs.py +125 -0
- google_genai-1.57.0/google/genai/tests/batches/test_create_with_inlined_requests.py +255 -0
- google_genai-1.57.0/google/genai/tests/batches/test_delete.py +86 -0
- google_genai-1.57.0/google/genai/tests/batches/test_embedding.py +157 -0
- google_genai-1.57.0/google/genai/tests/batches/test_get.py +78 -0
- google_genai-1.57.0/google/genai/tests/batches/test_list.py +79 -0
- google_genai-1.57.0/google/genai/tests/caches/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/caches/constants.py +29 -0
- google_genai-1.57.0/google/genai/tests/caches/test_create.py +210 -0
- google_genai-1.57.0/google/genai/tests/caches/test_create_custom_url.py +105 -0
- google_genai-1.57.0/google/genai/tests/caches/test_delete.py +54 -0
- google_genai-1.57.0/google/genai/tests/caches/test_delete_custom_url.py +52 -0
- google_genai-1.57.0/google/genai/tests/caches/test_get.py +94 -0
- google_genai-1.57.0/google/genai/tests/caches/test_get_custom_url.py +52 -0
- google_genai-1.57.0/google/genai/tests/caches/test_list.py +68 -0
- google_genai-1.57.0/google/genai/tests/caches/test_update.py +70 -0
- google_genai-1.57.0/google/genai/tests/caches/test_update_custom_url.py +58 -0
- google_genai-1.57.0/google/genai/tests/chats/__init__.py +1 -0
- google_genai-1.57.0/google/genai/tests/chats/test_get_history.py +598 -0
- google_genai-1.57.0/google/genai/tests/chats/test_send_message.py +844 -0
- google_genai-1.57.0/google/genai/tests/chats/test_validate_response.py +90 -0
- google_genai-1.57.0/google/genai/tests/client/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/client/test_async_stream.py +427 -0
- google_genai-1.57.0/google/genai/tests/client/test_client_close.py +197 -0
- google_genai-1.57.0/google/genai/tests/client/test_client_initialization.py +1687 -0
- google_genai-1.57.0/google/genai/tests/client/test_client_requests.py +221 -0
- google_genai-1.57.0/google/genai/tests/client/test_custom_client.py +77 -0
- google_genai-1.57.0/google/genai/tests/client/test_http_options.py +178 -0
- google_genai-1.57.0/google/genai/tests/client/test_replay_client_equality.py +168 -0
- google_genai-1.57.0/google/genai/tests/client/test_retries.py +846 -0
- google_genai-1.57.0/google/genai/tests/client/test_upload_errors.py +136 -0
- google_genai-1.57.0/google/genai/tests/common/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/common/test_common.py +954 -0
- google_genai-1.57.0/google/genai/tests/conftest.py +162 -0
- google_genai-1.57.0/google/genai/tests/documents/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/documents/test_delete.py +51 -0
- google_genai-1.57.0/google/genai/tests/documents/test_get.py +85 -0
- google_genai-1.57.0/google/genai/tests/documents/test_list.py +72 -0
- google_genai-1.57.0/google/genai/tests/errors/__init__.py +1 -0
- google_genai-1.57.0/google/genai/tests/errors/test_api_error.py +417 -0
- google_genai-1.57.0/google/genai/tests/file_search_stores/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/file_search_stores/test_create.py +66 -0
- google_genai-1.57.0/google/genai/tests/file_search_stores/test_delete.py +64 -0
- google_genai-1.57.0/google/genai/tests/file_search_stores/test_get.py +94 -0
- google_genai-1.57.0/google/genai/tests/file_search_stores/test_import_file.py +112 -0
- google_genai-1.57.0/google/genai/tests/file_search_stores/test_list.py +57 -0
- google_genai-1.57.0/google/genai/tests/file_search_stores/test_upload_to_file_search_store.py +141 -0
- google_genai-1.57.0/google/genai/tests/files/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/files/test_delete.py +46 -0
- google_genai-1.57.0/google/genai/tests/files/test_download.py +85 -0
- google_genai-1.57.0/google/genai/tests/files/test_get.py +46 -0
- google_genai-1.57.0/google/genai/tests/files/test_list.py +72 -0
- google_genai-1.57.0/google/genai/tests/files/test_register.py +272 -0
- google_genai-1.57.0/google/genai/tests/files/test_register_table.py +70 -0
- google_genai-1.57.0/google/genai/tests/files/test_upload.py +255 -0
- google_genai-1.57.0/google/genai/tests/imports/test_no_optional_imports.py +28 -0
- google_genai-1.57.0/google/genai/tests/interactions/test_auth.py +479 -0
- google_genai-1.57.0/google/genai/tests/interactions/test_integration.py +82 -0
- google_genai-1.57.0/google/genai/tests/interactions/test_paths.py +105 -0
- google_genai-1.57.0/google/genai/tests/live/__init__.py +16 -0
- google_genai-1.57.0/google/genai/tests/live/test_live.py +2143 -0
- google_genai-1.57.0/google/genai/tests/live/test_live_music.py +362 -0
- google_genai-1.57.0/google/genai/tests/live/test_live_response.py +163 -0
- google_genai-1.57.0/google/genai/tests/live/test_send_client_content.py +147 -0
- google_genai-1.57.0/google/genai/tests/live/test_send_realtime_input.py +268 -0
- google_genai-1.57.0/google/genai/tests/live/test_send_tool_response.py +222 -0
- google_genai-1.57.0/google/genai/tests/local_tokenizer/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/local_tokenizer/test_local_tokenizer.py +343 -0
- google_genai-1.57.0/google/genai/tests/local_tokenizer/test_local_tokenizer_loader.py +235 -0
- google_genai-1.57.0/google/genai/tests/mcp/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/mcp/test_has_mcp_tool_usage.py +89 -0
- google_genai-1.57.0/google/genai/tests/mcp/test_mcp_to_gemini_tools.py +191 -0
- google_genai-1.57.0/google/genai/tests/mcp/test_parse_config_for_mcp_sessions.py +201 -0
- google_genai-1.57.0/google/genai/tests/mcp/test_parse_config_for_mcp_usage.py +130 -0
- google_genai-1.57.0/google/genai/tests/mcp/test_set_mcp_usage_header.py +72 -0
- google_genai-1.57.0/google/genai/tests/models/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/models/constants.py +8 -0
- google_genai-1.57.0/google/genai/tests/models/test_compute_tokens.py +120 -0
- google_genai-1.57.0/google/genai/tests/models/test_count_tokens.py +159 -0
- google_genai-1.57.0/google/genai/tests/models/test_delete.py +107 -0
- google_genai-1.57.0/google/genai/tests/models/test_edit_image.py +264 -0
- google_genai-1.57.0/google/genai/tests/models/test_embed_content.py +94 -0
- google_genai-1.57.0/google/genai/tests/models/test_function_call_streaming.py +442 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content.py +2501 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_cached_content.py +132 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_config_zero_value.py +103 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_from_apikey.py +44 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_http_options.py +40 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_image_generation.py +143 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_mcp.py +343 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_media_resolution.py +97 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_model.py +139 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_part.py +821 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_thought.py +76 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_content_tools.py +1761 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_images.py +191 -0
- google_genai-1.57.0/google/genai/tests/models/test_generate_videos.py +759 -0
- google_genai-1.57.0/google/genai/tests/models/test_get.py +104 -0
- google_genai-1.57.0/google/genai/tests/models/test_list.py +233 -0
- google_genai-1.57.0/google/genai/tests/models/test_recontext_image.py +189 -0
- google_genai-1.57.0/google/genai/tests/models/test_segment_image.py +148 -0
- google_genai-1.57.0/google/genai/tests/models/test_update.py +95 -0
- google_genai-1.57.0/google/genai/tests/models/test_upscale_image.py +157 -0
- google_genai-1.57.0/google/genai/tests/operations/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/operations/test_get.py +38 -0
- google_genai-1.57.0/google/genai/tests/public_samples/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/public_samples/test_gemini_text_only.py +34 -0
- google_genai-1.57.0/google/genai/tests/pytest_helper.py +246 -0
- google_genai-1.57.0/google/genai/tests/shared/__init__.py +16 -0
- google_genai-1.57.0/google/genai/tests/shared/batches/__init__.py +14 -0
- google_genai-1.57.0/google/genai/tests/shared/batches/test_create_delete.py +57 -0
- google_genai-1.57.0/google/genai/tests/shared/batches/test_create_get_cancel.py +56 -0
- google_genai-1.57.0/google/genai/tests/shared/batches/test_list.py +40 -0
- google_genai-1.57.0/google/genai/tests/shared/caches/__init__.py +14 -0
- google_genai-1.57.0/google/genai/tests/shared/caches/test_create_get_delete.py +67 -0
- google_genai-1.57.0/google/genai/tests/shared/caches/test_create_update_get.py +71 -0
- google_genai-1.57.0/google/genai/tests/shared/caches/test_list.py +40 -0
- google_genai-1.57.0/google/genai/tests/shared/chats/__init__.py +14 -0
- google_genai-1.57.0/google/genai/tests/shared/chats/test_send_message.py +48 -0
- google_genai-1.57.0/google/genai/tests/shared/chats/test_send_message_stream.py +50 -0
- google_genai-1.57.0/google/genai/tests/shared/files/__init__.py +14 -0
- google_genai-1.57.0/google/genai/tests/shared/files/test_list.py +41 -0
- google_genai-1.57.0/google/genai/tests/shared/files/test_upload_get_delete.py +54 -0
- google_genai-1.57.0/google/genai/tests/shared/models/__init__.py +14 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_compute_tokens.py +41 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_count_tokens.py +40 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_edit_image.py +67 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_embed.py +40 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_generate_content.py +39 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_generate_content_stream.py +54 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_generate_images.py +40 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_generate_videos.py +38 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_list.py +37 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_recontext_image.py +55 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_segment_image.py +52 -0
- google_genai-1.57.0/google/genai/tests/shared/models/test_upscale_image.py +52 -0
- google_genai-1.57.0/google/genai/tests/shared/tunings/__init__.py +16 -0
- google_genai-1.57.0/google/genai/tests/shared/tunings/test_create.py +46 -0
- google_genai-1.57.0/google/genai/tests/shared/tunings/test_create_get_cancel.py +56 -0
- google_genai-1.57.0/google/genai/tests/shared/tunings/test_list.py +39 -0
- google_genai-1.57.0/google/genai/tests/tokens/__init__.py +16 -0
- google_genai-1.57.0/google/genai/tests/tokens/test_create.py +154 -0
- google_genai-1.57.0/google/genai/tests/transformers/__init__.py +17 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_blobs.py +71 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_bytes.py +15 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_duck_type.py +96 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_function_responses.py +72 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_schema.py +653 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_t_batch.py +286 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_t_content.py +160 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_t_contents.py +398 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_t_part.py +85 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_t_parts.py +87 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_t_tool.py +157 -0
- google_genai-1.57.0/google/genai/tests/transformers/test_t_tools.py +195 -0
- google_genai-1.57.0/google/genai/tests/tunings/__init__.py +16 -0
- google_genai-1.57.0/google/genai/tests/tunings/test_cancel.py +39 -0
- google_genai-1.57.0/google/genai/tests/tunings/test_end_to_end.py +106 -0
- google_genai-1.57.0/google/genai/tests/tunings/test_get.py +67 -0
- google_genai-1.57.0/google/genai/tests/tunings/test_list.py +75 -0
- google_genai-1.57.0/google/genai/tests/tunings/test_tune.py +268 -0
- google_genai-1.57.0/google/genai/tests/types/__init__.py +16 -0
- google_genai-1.57.0/google/genai/tests/types/test_bytes_internal.py +271 -0
- google_genai-1.57.0/google/genai/tests/types/test_bytes_type.py +152 -0
- google_genai-1.57.0/google/genai/tests/types/test_future.py +101 -0
- google_genai-1.57.0/google/genai/tests/types/test_optional_types.py +36 -0
- google_genai-1.57.0/google/genai/tests/types/test_part_type.py +616 -0
- google_genai-1.57.0/google/genai/tests/types/test_schema_from_json_schema.py +417 -0
- google_genai-1.57.0/google/genai/tests/types/test_schema_json_schema.py +468 -0
- google_genai-1.57.0/google/genai/tests/types/test_types.py +2903 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/types.py +585 -498
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/version.py +1 -1
- {google_genai-1.56.0 → google_genai-1.57.0/google_genai.egg-info}/PKG-INFO +2 -2
- google_genai-1.57.0/google_genai.egg-info/SOURCES.txt +358 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google_genai.egg-info/requires.txt +1 -1
- {google_genai-1.56.0 → google_genai-1.57.0}/pyproject.toml +5 -5
- google_genai-1.56.0/google/genai/_interactions/types/content_start.py +0 -79
- google_genai-1.56.0/google_genai.egg-info/SOURCES.txt +0 -167
- {google_genai-1.56.0 → google_genai-1.57.0}/LICENSE +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/MANIFEST.in +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/README.md +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/__init__.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_adapters.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_api_module.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_automatic_function_calling_util.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_base_transformers.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_base_url.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_common.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_extra_utils.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/__init__.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_client.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_compat.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_constants.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_exceptions.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_files.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_models.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_qs.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_resource.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_response.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_streaming.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_types.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/__init__.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_compat.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_datetime_parse.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_logs.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_proxy.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_reflection.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_resources_proxy.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_streams.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_sync.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_transform.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_typing.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_utils/_utils.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/_version.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/resources/__init__.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/resources/interactions.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/allowed_tools.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/allowed_tools_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/annotation.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/annotation_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/audio_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/audio_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/audio_mime_type.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/audio_mime_type_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/code_execution_call_arguments.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/code_execution_call_arguments_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/code_execution_call_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/code_execution_call_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/code_execution_result_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/code_execution_result_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/content_delta.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/content_stop.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/deep_research_agent_config.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/deep_research_agent_config_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/document_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/document_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/document_mime_type.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/document_mime_type_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/dynamic_agent_config.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/dynamic_agent_config_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/error_event.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/file_search_result_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/file_search_result_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/function.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/function_call_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/function_call_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/function_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/function_result_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/function_result_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/generation_config.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/generation_config_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/google_search_call_arguments.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/google_search_call_arguments_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/google_search_call_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/google_search_call_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/google_search_result.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/google_search_result_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/google_search_result_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/google_search_result_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/image_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/image_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/image_mime_type.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/image_mime_type_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/interaction_event.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/interaction_get_params.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/interaction_sse_event.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/interaction_status_update.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/mcp_server_tool_call_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/mcp_server_tool_call_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/mcp_server_tool_result_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/mcp_server_tool_result_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/speech_config.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/speech_config_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/text_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/text_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/thinking_level.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/thought_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/thought_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/tool.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/tool_choice.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/tool_choice_config.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/tool_choice_config_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/tool_choice_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/tool_choice_type.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/tool_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/url_context_call_arguments.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/url_context_call_arguments_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/url_context_call_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/url_context_call_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/url_context_result.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/url_context_result_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/url_context_result_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/url_context_result_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/video_content.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/video_content_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/video_mime_type.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_interactions/types/video_mime_type_param.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_live_converters.py +34 -34
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_mcp_utils.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_operations_converters.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_replay_api_client.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_test_api_client.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_tokens_converters.py +14 -14
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/_transformers.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/caches.py +42 -42
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/client.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/documents.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/errors.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/file_search_stores.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/interactions.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/live.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/live_music.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/local_tokenizer.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/operations.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/pagers.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/py.typed +0 -0
- /google_genai-1.56.0/google/genai/_interactions/py.typed → /google_genai-1.57.0/google/genai/tests/interactions/__init__.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/tokens.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google/genai/tunings.py +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google_genai.egg-info/dependency_links.txt +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/google_genai.egg-info/top_level.txt +0 -0
- {google_genai-1.56.0 → google_genai-1.57.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-genai
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.57.0
|
|
4
4
|
Summary: GenAI Python SDK
|
|
5
5
|
Author-email: Google LLC <googleapis-packages@google.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -20,7 +20,7 @@ Requires-Python: >=3.10
|
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Requires-Dist: anyio<5.0.0,>=4.8.0
|
|
23
|
-
Requires-Dist: google-auth[requests]<3.0.0,>=2.
|
|
23
|
+
Requires-Dist: google-auth[requests]<3.0.0,>=2.46.0
|
|
24
24
|
Requires-Dist: httpx<1.0.0,>=0.28.1
|
|
25
25
|
Requires-Dist: pydantic<3.0.0,>=2.9.0
|
|
26
26
|
Requires-Dist: requests<3.0.0,>=2.28.1
|
|
@@ -984,12 +984,7 @@ class BaseApiClient:
|
|
|
984
984
|
self.project = project
|
|
985
985
|
|
|
986
986
|
if self._credentials:
|
|
987
|
-
|
|
988
|
-
# Only refresh when it needs to. Default expiration is 3600 seconds.
|
|
989
|
-
refresh_auth(self._credentials)
|
|
990
|
-
if not self._credentials.token:
|
|
991
|
-
raise RuntimeError('Could not resolve API token from the environment')
|
|
992
|
-
return self._credentials.token # type: ignore[no-any-return]
|
|
987
|
+
return get_token_from_credentials(self, self._credentials) # type: ignore[no-any-return]
|
|
993
988
|
else:
|
|
994
989
|
raise RuntimeError('Could not resolve API token from the environment')
|
|
995
990
|
|
|
@@ -1034,18 +1029,10 @@ class BaseApiClient:
|
|
|
1034
1029
|
self.project = project
|
|
1035
1030
|
|
|
1036
1031
|
if self._credentials:
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
if self._credentials.expired or not self._credentials.token:
|
|
1042
|
-
# Double check that the credentials expired before refreshing.
|
|
1043
|
-
await asyncio.to_thread(refresh_auth, self._credentials)
|
|
1044
|
-
|
|
1045
|
-
if not self._credentials.token:
|
|
1046
|
-
raise RuntimeError('Could not resolve API token from the environment')
|
|
1047
|
-
|
|
1048
|
-
return self._credentials.token
|
|
1032
|
+
return await async_get_token_from_credentials(
|
|
1033
|
+
self,
|
|
1034
|
+
self._credentials
|
|
1035
|
+
) # type: ignore[no-any-return]
|
|
1049
1036
|
else:
|
|
1050
1037
|
raise RuntimeError('Could not resolve API token from the environment')
|
|
1051
1038
|
|
|
@@ -1925,3 +1912,35 @@ class BaseApiClient:
|
|
|
1925
1912
|
asyncio.get_running_loop().create_task(self.aclose())
|
|
1926
1913
|
except Exception: # pylint: disable=broad-except
|
|
1927
1914
|
pass
|
|
1915
|
+
|
|
1916
|
+
def get_token_from_credentials(
|
|
1917
|
+
client: 'BaseApiClient',
|
|
1918
|
+
credentials: google.auth.credentials.Credentials
|
|
1919
|
+
) -> str:
|
|
1920
|
+
"""Refreshes the authentication token for the given credentials."""
|
|
1921
|
+
if credentials.expired or not credentials.token:
|
|
1922
|
+
# Only refresh when it needs to. Default expiration is 3600 seconds.
|
|
1923
|
+
refresh_auth(credentials)
|
|
1924
|
+
if not credentials.token:
|
|
1925
|
+
raise RuntimeError('Could not resolve API token from the environment')
|
|
1926
|
+
return credentials.token # type: ignore[no-any-return]
|
|
1927
|
+
|
|
1928
|
+
async def async_get_token_from_credentials(
|
|
1929
|
+
client: 'BaseApiClient',
|
|
1930
|
+
credentials: google.auth.credentials.Credentials
|
|
1931
|
+
) -> str:
|
|
1932
|
+
"""Refreshes the authentication token for the given credentials."""
|
|
1933
|
+
if credentials.expired or not credentials.token:
|
|
1934
|
+
# Only refresh when it needs to. Default expiration is 3600 seconds.
|
|
1935
|
+
async_auth_lock = await client._get_async_auth_lock()
|
|
1936
|
+
async with async_auth_lock:
|
|
1937
|
+
if credentials.expired or not credentials.token:
|
|
1938
|
+
# Double check that the credentials expired before refreshing.
|
|
1939
|
+
await asyncio.to_thread(refresh_auth, credentials)
|
|
1940
|
+
|
|
1941
|
+
if not credentials.token:
|
|
1942
|
+
raise RuntimeError('Could not resolve API token from the environment')
|
|
1943
|
+
|
|
1944
|
+
return credentials.token # type: ignore[no-any-return]
|
|
1945
|
+
|
|
1946
|
+
|
|
@@ -1798,7 +1798,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1798
1798
|
options: RequestOptions = {},
|
|
1799
1799
|
) -> ResponseT:
|
|
1800
1800
|
opts = FinalRequestOptions.construct(
|
|
1801
|
-
method="patch", url=path, json_data=body, files=
|
|
1801
|
+
method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options
|
|
1802
1802
|
)
|
|
1803
1803
|
return await self.request(cast_to, opts)
|
|
1804
1804
|
|
|
@@ -21,6 +21,7 @@ from .tool import Tool as Tool
|
|
|
21
21
|
from .turn import Turn as Turn
|
|
22
22
|
from .model import Model as Model
|
|
23
23
|
from .usage import Usage as Usage
|
|
24
|
+
from .content import Content as Content
|
|
24
25
|
from .function import Function as Function
|
|
25
26
|
from .annotation import Annotation as Annotation
|
|
26
27
|
from .tool_param import ToolParam as ToolParam
|
|
@@ -35,6 +36,7 @@ from .text_content import TextContent as TextContent
|
|
|
35
36
|
from .allowed_tools import AllowedTools as AllowedTools
|
|
36
37
|
from .audio_content import AudioContent as AudioContent
|
|
37
38
|
from .content_delta import ContentDelta as ContentDelta
|
|
39
|
+
from .content_param import ContentParam as ContentParam
|
|
38
40
|
from .content_start import ContentStart as ContentStart
|
|
39
41
|
from .image_content import ImageContent as ImageContent
|
|
40
42
|
from .speech_config import SpeechConfig as SpeechConfig
|
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
17
17
|
|
|
18
|
-
from typing import
|
|
18
|
+
from typing import Union
|
|
19
19
|
from typing_extensions import Annotated, TypeAlias
|
|
20
20
|
|
|
21
21
|
from .._utils import PropertyInfo
|
|
22
|
-
from .._models import BaseModel
|
|
23
22
|
from .text_content import TextContent
|
|
24
23
|
from .audio_content import AudioContent
|
|
25
24
|
from .image_content import ImageContent
|
|
@@ -38,9 +37,9 @@ from .mcp_server_tool_call_content import MCPServerToolCallContent
|
|
|
38
37
|
from .code_execution_result_content import CodeExecutionResultContent
|
|
39
38
|
from .mcp_server_tool_result_content import MCPServerToolResultContent
|
|
40
39
|
|
|
41
|
-
__all__ = ["
|
|
40
|
+
__all__ = ["Content"]
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
Content: TypeAlias = Annotated[
|
|
44
43
|
Union[
|
|
45
44
|
TextContent,
|
|
46
45
|
ImageContent,
|
|
@@ -62,15 +61,3 @@ ContentUnionMember1: TypeAlias = Annotated[
|
|
|
62
61
|
],
|
|
63
62
|
PropertyInfo(discriminator="type"),
|
|
64
63
|
]
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
class Turn(BaseModel):
|
|
68
|
-
content: Union[str, List[ContentUnionMember1], None] = None
|
|
69
|
-
"""The content of the turn."""
|
|
70
|
-
|
|
71
|
-
role: Optional[str] = None
|
|
72
|
-
"""The originator of this turn.
|
|
73
|
-
|
|
74
|
-
Must be user for input or model for
|
|
75
|
-
model output.
|
|
76
|
-
"""
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
from typing import Union
|
|
21
|
-
from typing_extensions import TypeAlias
|
|
20
|
+
from typing import Union
|
|
21
|
+
from typing_extensions import TypeAlias
|
|
22
22
|
|
|
23
23
|
from .text_content_param import TextContentParam
|
|
24
24
|
from .audio_content_param import AudioContentParam
|
|
@@ -38,9 +38,9 @@ from .mcp_server_tool_call_content_param import MCPServerToolCallContentParam
|
|
|
38
38
|
from .code_execution_result_content_param import CodeExecutionResultContentParam
|
|
39
39
|
from .mcp_server_tool_result_content_param import MCPServerToolResultContentParam
|
|
40
40
|
|
|
41
|
-
__all__ = ["
|
|
41
|
+
__all__ = ["ContentParam"]
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
ContentParam: TypeAlias = Union[
|
|
44
44
|
TextContentParam,
|
|
45
45
|
ImageContentParam,
|
|
46
46
|
AudioContentParam,
|
|
@@ -59,15 +59,3 @@ ContentUnionMember1: TypeAlias = Union[
|
|
|
59
59
|
MCPServerToolResultContentParam,
|
|
60
60
|
FileSearchResultContentParam,
|
|
61
61
|
]
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class TurnParam(TypedDict, total=False):
|
|
65
|
-
content: Union[str, Iterable[ContentUnionMember1]]
|
|
66
|
-
"""The content of the turn."""
|
|
67
|
-
|
|
68
|
-
role: str
|
|
69
|
-
"""The originator of this turn.
|
|
70
|
-
|
|
71
|
-
Must be user for input or model for
|
|
72
|
-
model output.
|
|
73
|
-
"""
|
|
@@ -0,0 +1,39 @@
|
|
|
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 .content import Content
|
|
22
|
+
from .._models import BaseModel
|
|
23
|
+
|
|
24
|
+
__all__ = ["ContentStart"]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ContentStart(BaseModel):
|
|
28
|
+
content: Optional[Content] = None
|
|
29
|
+
"""The content of the response."""
|
|
30
|
+
|
|
31
|
+
event_id: Optional[str] = None
|
|
32
|
+
"""
|
|
33
|
+
The event_id token to be used to resume the interaction stream, from
|
|
34
|
+
this event.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
event_type: Optional[Literal["content.start"]] = None
|
|
38
|
+
|
|
39
|
+
index: Optional[int] = None
|
|
@@ -23,6 +23,7 @@ from .turn import Turn
|
|
|
23
23
|
from .model import Model
|
|
24
24
|
from .usage import Usage
|
|
25
25
|
from .._utils import PropertyInfo
|
|
26
|
+
from .content import Content
|
|
26
27
|
from .._models import BaseModel
|
|
27
28
|
from .text_content import TextContent
|
|
28
29
|
from .audio_content import AudioContent
|
|
@@ -44,38 +45,15 @@ from .mcp_server_tool_call_content import MCPServerToolCallContent
|
|
|
44
45
|
from .code_execution_result_content import CodeExecutionResultContent
|
|
45
46
|
from .mcp_server_tool_result_content import MCPServerToolResultContent
|
|
46
47
|
|
|
47
|
-
__all__ = ["Interaction", "AgentConfig", "Input"
|
|
48
|
+
__all__ = ["Interaction", "AgentConfig", "Input"]
|
|
48
49
|
|
|
49
50
|
AgentConfig: TypeAlias = Annotated[
|
|
50
51
|
Union[DynamicAgentConfig, DeepResearchAgentConfig], PropertyInfo(discriminator="type")
|
|
51
52
|
]
|
|
52
53
|
|
|
53
|
-
InputContentList: TypeAlias = Annotated[
|
|
54
|
-
Union[
|
|
55
|
-
TextContent,
|
|
56
|
-
ImageContent,
|
|
57
|
-
AudioContent,
|
|
58
|
-
DocumentContent,
|
|
59
|
-
VideoContent,
|
|
60
|
-
ThoughtContent,
|
|
61
|
-
FunctionCallContent,
|
|
62
|
-
FunctionResultContent,
|
|
63
|
-
CodeExecutionCallContent,
|
|
64
|
-
CodeExecutionResultContent,
|
|
65
|
-
URLContextCallContent,
|
|
66
|
-
URLContextResultContent,
|
|
67
|
-
GoogleSearchCallContent,
|
|
68
|
-
GoogleSearchResultContent,
|
|
69
|
-
MCPServerToolCallContent,
|
|
70
|
-
MCPServerToolResultContent,
|
|
71
|
-
FileSearchResultContent,
|
|
72
|
-
],
|
|
73
|
-
PropertyInfo(discriminator="type"),
|
|
74
|
-
]
|
|
75
|
-
|
|
76
54
|
Input: TypeAlias = Union[
|
|
77
55
|
str,
|
|
78
|
-
List[
|
|
56
|
+
List[Content],
|
|
79
57
|
List[Turn],
|
|
80
58
|
TextContent,
|
|
81
59
|
ImageContent,
|
|
@@ -96,29 +74,6 @@ Input: TypeAlias = Union[
|
|
|
96
74
|
FileSearchResultContent,
|
|
97
75
|
]
|
|
98
76
|
|
|
99
|
-
Output: TypeAlias = Annotated[
|
|
100
|
-
Union[
|
|
101
|
-
TextContent,
|
|
102
|
-
ImageContent,
|
|
103
|
-
AudioContent,
|
|
104
|
-
DocumentContent,
|
|
105
|
-
VideoContent,
|
|
106
|
-
ThoughtContent,
|
|
107
|
-
FunctionCallContent,
|
|
108
|
-
FunctionResultContent,
|
|
109
|
-
CodeExecutionCallContent,
|
|
110
|
-
CodeExecutionResultContent,
|
|
111
|
-
URLContextCallContent,
|
|
112
|
-
URLContextResultContent,
|
|
113
|
-
GoogleSearchCallContent,
|
|
114
|
-
GoogleSearchResultContent,
|
|
115
|
-
MCPServerToolCallContent,
|
|
116
|
-
MCPServerToolResultContent,
|
|
117
|
-
FileSearchResultContent,
|
|
118
|
-
],
|
|
119
|
-
PropertyInfo(discriminator="type"),
|
|
120
|
-
]
|
|
121
|
-
|
|
122
77
|
|
|
123
78
|
class Interaction(BaseModel):
|
|
124
79
|
"""The Interaction resource."""
|
|
@@ -142,10 +97,7 @@ class Interaction(BaseModel):
|
|
|
142
97
|
model: Optional[Model] = None
|
|
143
98
|
"""The name of the `Model` used for generating the interaction."""
|
|
144
99
|
|
|
145
|
-
|
|
146
|
-
"""Output only. The object type of the interaction. Always set to `interaction`."""
|
|
147
|
-
|
|
148
|
-
outputs: Optional[List[Output]] = None
|
|
100
|
+
outputs: Optional[List[Content]] = None
|
|
149
101
|
"""Output only. Responses from the model."""
|
|
150
102
|
|
|
151
103
|
previous_interaction_id: Optional[str] = None
|
|
@@ -23,6 +23,7 @@ from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
|
|
23
23
|
from .tool_param import ToolParam
|
|
24
24
|
from .turn_param import TurnParam
|
|
25
25
|
from .model_param import ModelParam
|
|
26
|
+
from .content_param import ContentParam
|
|
26
27
|
from .text_content_param import TextContentParam
|
|
27
28
|
from .audio_content_param import AudioContentParam
|
|
28
29
|
from .image_content_param import ImageContentParam
|
|
@@ -47,7 +48,6 @@ from .mcp_server_tool_result_content_param import MCPServerToolResultContentPara
|
|
|
47
48
|
__all__ = [
|
|
48
49
|
"BaseCreateModelInteractionParams",
|
|
49
50
|
"Input",
|
|
50
|
-
"ContentList",
|
|
51
51
|
"BaseCreateAgentInteractionParams",
|
|
52
52
|
"AgentConfig",
|
|
53
53
|
"CreateModelInteractionParamsNonStreaming",
|
|
@@ -97,29 +97,9 @@ class BaseCreateModelInteractionParams(TypedDict, total=False):
|
|
|
97
97
|
"""A list of tool declarations the model may call during interaction."""
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
ContentList: TypeAlias = Union[
|
|
101
|
-
TextContentParam,
|
|
102
|
-
ImageContentParam,
|
|
103
|
-
AudioContentParam,
|
|
104
|
-
DocumentContentParam,
|
|
105
|
-
VideoContentParam,
|
|
106
|
-
ThoughtContentParam,
|
|
107
|
-
FunctionCallContentParam,
|
|
108
|
-
FunctionResultContentParam,
|
|
109
|
-
CodeExecutionCallContentParam,
|
|
110
|
-
CodeExecutionResultContentParam,
|
|
111
|
-
URLContextCallContentParam,
|
|
112
|
-
URLContextResultContentParam,
|
|
113
|
-
GoogleSearchCallContentParam,
|
|
114
|
-
GoogleSearchResultContentParam,
|
|
115
|
-
MCPServerToolCallContentParam,
|
|
116
|
-
MCPServerToolResultContentParam,
|
|
117
|
-
FileSearchResultContentParam,
|
|
118
|
-
]
|
|
119
|
-
|
|
120
100
|
Input: TypeAlias = Union[
|
|
121
101
|
str,
|
|
122
|
-
Iterable[
|
|
102
|
+
Iterable[ContentParam],
|
|
123
103
|
Iterable[TurnParam],
|
|
124
104
|
TextContentParam,
|
|
125
105
|
ImageContentParam,
|
|
@@ -0,0 +1,35 @@
|
|
|
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, Union, Optional
|
|
19
|
+
|
|
20
|
+
from .content import Content
|
|
21
|
+
from .._models import BaseModel
|
|
22
|
+
|
|
23
|
+
__all__ = ["Turn"]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Turn(BaseModel):
|
|
27
|
+
content: Union[str, List[Content], None] = None
|
|
28
|
+
"""The content of the turn."""
|
|
29
|
+
|
|
30
|
+
role: Optional[str] = None
|
|
31
|
+
"""The originator of this turn.
|
|
32
|
+
|
|
33
|
+
Must be user for input or model for
|
|
34
|
+
model output.
|
|
35
|
+
"""
|
|
@@ -0,0 +1,37 @@
|
|
|
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 __future__ import annotations
|
|
19
|
+
|
|
20
|
+
from typing import Union, Iterable
|
|
21
|
+
from typing_extensions import TypedDict
|
|
22
|
+
|
|
23
|
+
from .content_param import ContentParam
|
|
24
|
+
|
|
25
|
+
__all__ = ["TurnParam"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class TurnParam(TypedDict, total=False):
|
|
29
|
+
content: Union[str, Iterable[ContentParam]]
|
|
30
|
+
"""The content of the turn."""
|
|
31
|
+
|
|
32
|
+
role: str
|
|
33
|
+
"""The originator of this turn.
|
|
34
|
+
|
|
35
|
+
Must be user for input or model for
|
|
36
|
+
model output.
|
|
37
|
+
"""
|
|
@@ -93,7 +93,7 @@ class Usage(BaseModel):
|
|
|
93
93
|
total_output_tokens: Optional[int] = None
|
|
94
94
|
"""Total number of tokens across all the generated responses."""
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
total_thought_tokens: Optional[int] = None
|
|
97
97
|
"""Number of tokens of thoughts for thinking models."""
|
|
98
98
|
|
|
99
99
|
total_tokens: Optional[int] = None
|
|
@@ -93,7 +93,7 @@ class UsageParam(TypedDict, total=False):
|
|
|
93
93
|
total_output_tokens: int
|
|
94
94
|
"""Total number of tokens across all the generated responses."""
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
total_thought_tokens: int
|
|
97
97
|
"""Number of tokens of thoughts for thinking models."""
|
|
98
98
|
|
|
99
99
|
total_tokens: int
|
|
@@ -824,9 +824,6 @@ def _FunctionCallingConfig_to_mldev(
|
|
|
824
824
|
parent_object: Optional[dict[str, Any]] = None,
|
|
825
825
|
) -> dict[str, Any]:
|
|
826
826
|
to_object: dict[str, Any] = {}
|
|
827
|
-
if getv(from_object, ['mode']) is not None:
|
|
828
|
-
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
|
829
|
-
|
|
830
827
|
if getv(from_object, ['allowed_function_names']) is not None:
|
|
831
828
|
setv(
|
|
832
829
|
to_object,
|
|
@@ -834,6 +831,9 @@ def _FunctionCallingConfig_to_mldev(
|
|
|
834
831
|
getv(from_object, ['allowed_function_names']),
|
|
835
832
|
)
|
|
836
833
|
|
|
834
|
+
if getv(from_object, ['mode']) is not None:
|
|
835
|
+
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
|
836
|
+
|
|
837
837
|
if getv(from_object, ['stream_function_call_arguments']) is not None:
|
|
838
838
|
raise ValueError(
|
|
839
839
|
'stream_function_call_arguments parameter is not supported in Gemini'
|
|
@@ -1131,6 +1131,11 @@ def _ImageConfig_to_mldev(
|
|
|
1131
1131
|
if getv(from_object, ['image_size']) is not None:
|
|
1132
1132
|
setv(to_object, ['imageSize'], getv(from_object, ['image_size']))
|
|
1133
1133
|
|
|
1134
|
+
if getv(from_object, ['person_generation']) is not None:
|
|
1135
|
+
raise ValueError(
|
|
1136
|
+
'person_generation parameter is not supported in Gemini API.'
|
|
1137
|
+
)
|
|
1138
|
+
|
|
1134
1139
|
if getv(from_object, ['output_mime_type']) is not None:
|
|
1135
1140
|
raise ValueError(
|
|
1136
1141
|
'output_mime_type parameter is not supported in Gemini API.'
|
|
@@ -1415,6 +1420,11 @@ def _ToolConfig_to_mldev(
|
|
|
1415
1420
|
parent_object: Optional[dict[str, Any]] = None,
|
|
1416
1421
|
) -> dict[str, Any]:
|
|
1417
1422
|
to_object: dict[str, Any] = {}
|
|
1423
|
+
if getv(from_object, ['retrieval_config']) is not None:
|
|
1424
|
+
setv(
|
|
1425
|
+
to_object, ['retrievalConfig'], getv(from_object, ['retrieval_config'])
|
|
1426
|
+
)
|
|
1427
|
+
|
|
1418
1428
|
if getv(from_object, ['function_calling_config']) is not None:
|
|
1419
1429
|
setv(
|
|
1420
1430
|
to_object,
|
|
@@ -1424,11 +1434,6 @@ def _ToolConfig_to_mldev(
|
|
|
1424
1434
|
),
|
|
1425
1435
|
)
|
|
1426
1436
|
|
|
1427
|
-
if getv(from_object, ['retrieval_config']) is not None:
|
|
1428
|
-
setv(
|
|
1429
|
-
to_object, ['retrievalConfig'], getv(from_object, ['retrieval_config'])
|
|
1430
|
-
)
|
|
1431
|
-
|
|
1432
1437
|
return to_object
|
|
1433
1438
|
|
|
1434
1439
|
|
|
@@ -1437,23 +1442,9 @@ def _Tool_to_mldev(
|
|
|
1437
1442
|
parent_object: Optional[dict[str, Any]] = None,
|
|
1438
1443
|
) -> dict[str, Any]:
|
|
1439
1444
|
to_object: dict[str, Any] = {}
|
|
1440
|
-
if getv(from_object, ['function_declarations']) is not None:
|
|
1441
|
-
setv(
|
|
1442
|
-
to_object,
|
|
1443
|
-
['functionDeclarations'],
|
|
1444
|
-
[item for item in getv(from_object, ['function_declarations'])],
|
|
1445
|
-
)
|
|
1446
|
-
|
|
1447
1445
|
if getv(from_object, ['retrieval']) is not None:
|
|
1448
1446
|
raise ValueError('retrieval parameter is not supported in Gemini API.')
|
|
1449
1447
|
|
|
1450
|
-
if getv(from_object, ['google_search_retrieval']) is not None:
|
|
1451
|
-
setv(
|
|
1452
|
-
to_object,
|
|
1453
|
-
['googleSearchRetrieval'],
|
|
1454
|
-
getv(from_object, ['google_search_retrieval']),
|
|
1455
|
-
)
|
|
1456
|
-
|
|
1457
1448
|
if getv(from_object, ['computer_use']) is not None:
|
|
1458
1449
|
setv(to_object, ['computerUse'], getv(from_object, ['computer_use']))
|
|
1459
1450
|
|
|
@@ -1468,6 +1459,13 @@ def _Tool_to_mldev(
|
|
|
1468
1459
|
'enterprise_web_search parameter is not supported in Gemini API.'
|
|
1469
1460
|
)
|
|
1470
1461
|
|
|
1462
|
+
if getv(from_object, ['function_declarations']) is not None:
|
|
1463
|
+
setv(
|
|
1464
|
+
to_object,
|
|
1465
|
+
['functionDeclarations'],
|
|
1466
|
+
[item for item in getv(from_object, ['function_declarations'])],
|
|
1467
|
+
)
|
|
1468
|
+
|
|
1471
1469
|
if getv(from_object, ['google_maps']) is not None:
|
|
1472
1470
|
setv(
|
|
1473
1471
|
to_object,
|
|
@@ -1482,6 +1480,13 @@ def _Tool_to_mldev(
|
|
|
1482
1480
|
_GoogleSearch_to_mldev(getv(from_object, ['google_search']), to_object),
|
|
1483
1481
|
)
|
|
1484
1482
|
|
|
1483
|
+
if getv(from_object, ['google_search_retrieval']) is not None:
|
|
1484
|
+
setv(
|
|
1485
|
+
to_object,
|
|
1486
|
+
['googleSearchRetrieval'],
|
|
1487
|
+
getv(from_object, ['google_search_retrieval']),
|
|
1488
|
+
)
|
|
1489
|
+
|
|
1485
1490
|
if getv(from_object, ['url_context']) is not None:
|
|
1486
1491
|
setv(to_object, ['urlContext'], getv(from_object, ['url_context']))
|
|
1487
1492
|
|