google-genai 1.57.0__tar.gz → 1.59.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.
Files changed (364) hide show
  1. {google_genai-1.57.0/google_genai.egg-info → google_genai-1.59.0}/PKG-INFO +6 -11
  2. {google_genai-1.57.0 → google_genai-1.59.0}/README.md +4 -9
  3. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_api_client.py +19 -10
  4. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/__init__.py +3 -0
  5. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_base_client.py +134 -11
  6. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_client.py +57 -3
  7. google_genai-1.59.0/google/genai/_interactions/_client_adapter.py +48 -0
  8. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_models.py +16 -1
  9. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_types.py +9 -0
  10. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/__init__.py +4 -0
  11. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/audio_content.py +2 -0
  12. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/audio_content_param.py +2 -0
  13. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/content.py +2 -0
  14. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/content_delta.py +10 -2
  15. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/content_param.py +2 -0
  16. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/content_start.py +1 -2
  17. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/content_stop.py +1 -2
  18. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/document_content.py +2 -0
  19. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/document_content_param.py +2 -0
  20. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/error_event.py +1 -2
  21. google_genai-1.59.0/google/genai/_interactions/types/file_search_call_content.py +32 -0
  22. google_genai-1.59.0/google/genai/_interactions/types/file_search_call_content_param.py +31 -0
  23. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/generation_config.py +4 -0
  24. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/generation_config_param.py +4 -0
  25. google_genai-1.59.0/google/genai/_interactions/types/image_config.py +31 -0
  26. google_genai-1.59.0/google/genai/_interactions/types/image_config_param.py +30 -0
  27. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/image_content.py +2 -0
  28. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/image_content_param.py +2 -0
  29. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/interaction.py +2 -0
  30. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/interaction_create_params.py +2 -0
  31. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/interaction_event.py +1 -2
  32. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/interaction_sse_event.py +5 -3
  33. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/interaction_status_update.py +1 -2
  34. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/video_content.py +2 -0
  35. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/video_content_param.py +2 -0
  36. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_live_converters.py +84 -0
  37. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_transformers.py +15 -21
  38. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/client.py +61 -55
  39. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/live.py +1 -1
  40. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/client/test_custom_client.py +27 -0
  41. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/client/test_http_options.py +1 -1
  42. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/interactions/test_auth.py +1 -4
  43. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/interactions/test_integration.py +2 -0
  44. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_blobs.py +16 -3
  45. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/types.py +58 -2
  46. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/version.py +1 -1
  47. {google_genai-1.57.0 → google_genai-1.59.0/google_genai.egg-info}/PKG-INFO +6 -11
  48. {google_genai-1.57.0 → google_genai-1.59.0}/google_genai.egg-info/SOURCES.txt +5 -0
  49. {google_genai-1.57.0 → google_genai-1.59.0}/google_genai.egg-info/requires.txt +1 -1
  50. {google_genai-1.57.0 → google_genai-1.59.0}/pyproject.toml +2 -2
  51. {google_genai-1.57.0 → google_genai-1.59.0}/LICENSE +0 -0
  52. {google_genai-1.57.0 → google_genai-1.59.0}/MANIFEST.in +0 -0
  53. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/__init__.py +0 -0
  54. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_adapters.py +0 -0
  55. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_api_module.py +0 -0
  56. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_automatic_function_calling_util.py +0 -0
  57. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_base_transformers.py +0 -0
  58. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_base_url.py +0 -0
  59. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_common.py +0 -0
  60. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_extra_utils.py +0 -0
  61. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_compat.py +0 -0
  62. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_constants.py +0 -0
  63. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_exceptions.py +0 -0
  64. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_files.py +0 -0
  65. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_qs.py +0 -0
  66. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_resource.py +0 -0
  67. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_response.py +0 -0
  68. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_streaming.py +0 -0
  69. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/__init__.py +0 -0
  70. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_compat.py +0 -0
  71. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_datetime_parse.py +0 -0
  72. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_logs.py +0 -0
  73. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_proxy.py +0 -0
  74. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_reflection.py +0 -0
  75. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_resources_proxy.py +0 -0
  76. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_streams.py +0 -0
  77. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_sync.py +0 -0
  78. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_transform.py +0 -0
  79. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_typing.py +0 -0
  80. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_utils/_utils.py +0 -0
  81. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/_version.py +0 -0
  82. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/resources/__init__.py +0 -0
  83. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/resources/interactions.py +0 -0
  84. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/allowed_tools.py +0 -0
  85. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/allowed_tools_param.py +0 -0
  86. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/annotation.py +0 -0
  87. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/annotation_param.py +0 -0
  88. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/audio_mime_type.py +0 -0
  89. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/audio_mime_type_param.py +0 -0
  90. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/code_execution_call_arguments.py +0 -0
  91. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/code_execution_call_arguments_param.py +0 -0
  92. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/code_execution_call_content.py +0 -0
  93. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/code_execution_call_content_param.py +0 -0
  94. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/code_execution_result_content.py +0 -0
  95. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/code_execution_result_content_param.py +0 -0
  96. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/deep_research_agent_config.py +0 -0
  97. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/deep_research_agent_config_param.py +0 -0
  98. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/document_mime_type.py +0 -0
  99. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/document_mime_type_param.py +0 -0
  100. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/dynamic_agent_config.py +0 -0
  101. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/dynamic_agent_config_param.py +0 -0
  102. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/file_search_result_content.py +0 -0
  103. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/file_search_result_content_param.py +0 -0
  104. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/function.py +0 -0
  105. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/function_call_content.py +0 -0
  106. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/function_call_content_param.py +0 -0
  107. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/function_param.py +0 -0
  108. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/function_result_content.py +0 -0
  109. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/function_result_content_param.py +0 -0
  110. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/google_search_call_arguments.py +0 -0
  111. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/google_search_call_arguments_param.py +0 -0
  112. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/google_search_call_content.py +0 -0
  113. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/google_search_call_content_param.py +0 -0
  114. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/google_search_result.py +0 -0
  115. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/google_search_result_content.py +0 -0
  116. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/google_search_result_content_param.py +0 -0
  117. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/google_search_result_param.py +0 -0
  118. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/image_mime_type.py +0 -0
  119. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/image_mime_type_param.py +0 -0
  120. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/interaction_get_params.py +0 -0
  121. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/mcp_server_tool_call_content.py +0 -0
  122. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/mcp_server_tool_call_content_param.py +0 -0
  123. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/mcp_server_tool_result_content.py +0 -0
  124. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/mcp_server_tool_result_content_param.py +0 -0
  125. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/model.py +0 -0
  126. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/model_param.py +0 -0
  127. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/speech_config.py +0 -0
  128. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/speech_config_param.py +0 -0
  129. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/text_content.py +0 -0
  130. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/text_content_param.py +0 -0
  131. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/thinking_level.py +0 -0
  132. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/thought_content.py +0 -0
  133. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/thought_content_param.py +0 -0
  134. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/tool.py +0 -0
  135. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/tool_choice.py +0 -0
  136. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/tool_choice_config.py +0 -0
  137. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/tool_choice_config_param.py +0 -0
  138. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/tool_choice_param.py +0 -0
  139. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/tool_choice_type.py +0 -0
  140. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/tool_param.py +0 -0
  141. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/turn.py +0 -0
  142. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/turn_param.py +0 -0
  143. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/url_context_call_arguments.py +0 -0
  144. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/url_context_call_arguments_param.py +0 -0
  145. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/url_context_call_content.py +0 -0
  146. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/url_context_call_content_param.py +0 -0
  147. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/url_context_result.py +0 -0
  148. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/url_context_result_content.py +0 -0
  149. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/url_context_result_content_param.py +0 -0
  150. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/url_context_result_param.py +0 -0
  151. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/usage.py +0 -0
  152. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/usage_param.py +0 -0
  153. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/video_mime_type.py +0 -0
  154. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_interactions/types/video_mime_type_param.py +0 -0
  155. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_local_tokenizer_loader.py +0 -0
  156. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_mcp_utils.py +0 -0
  157. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_operations_converters.py +0 -0
  158. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_replay_api_client.py +0 -0
  159. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_test_api_client.py +0 -0
  160. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/_tokens_converters.py +0 -0
  161. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/batches.py +0 -0
  162. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/caches.py +0 -0
  163. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/chats.py +0 -0
  164. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/documents.py +0 -0
  165. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/errors.py +0 -0
  166. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/file_search_stores.py +0 -0
  167. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/files.py +0 -0
  168. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/interactions.py +0 -0
  169. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/live_music.py +0 -0
  170. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/local_tokenizer.py +0 -0
  171. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/models.py +0 -0
  172. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/operations.py +0 -0
  173. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/pagers.py +0 -0
  174. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/py.typed +0 -0
  175. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/__init__.py +0 -0
  176. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/__init__.py +0 -0
  177. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_convert_if_exist_pydantic_model.py +0 -0
  178. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_convert_number_values_for_function_call_args.py +0 -0
  179. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_find_afc_incompatible_tool_indexes.py +0 -0
  180. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_generate_content_stream_afc.py +0 -0
  181. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_generate_content_stream_afc_thoughts.py +0 -0
  182. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_get_function_map.py +0 -0
  183. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_get_function_response_parts.py +0 -0
  184. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_get_max_remote_calls_for_afc.py +0 -0
  185. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_invoke_function_from_dict_args.py +0 -0
  186. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_raise_error_for_afc_incompatible_config.py +0 -0
  187. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_should_append_afc_history.py +0 -0
  188. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/afc/test_should_disable_afc.py +0 -0
  189. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/__init__.py +0 -0
  190. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/test_cancel.py +0 -0
  191. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/test_create.py +0 -0
  192. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/test_create_with_bigquery.py +0 -0
  193. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/test_create_with_file.py +0 -0
  194. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/test_create_with_gcs.py +0 -0
  195. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/test_create_with_inlined_requests.py +0 -0
  196. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/test_delete.py +0 -0
  197. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/test_embedding.py +0 -0
  198. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/test_get.py +0 -0
  199. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/batches/test_list.py +0 -0
  200. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/__init__.py +0 -0
  201. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/constants.py +0 -0
  202. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/test_create.py +0 -0
  203. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/test_create_custom_url.py +0 -0
  204. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/test_delete.py +0 -0
  205. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/test_delete_custom_url.py +0 -0
  206. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/test_get.py +0 -0
  207. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/test_get_custom_url.py +0 -0
  208. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/test_list.py +0 -0
  209. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/test_update.py +0 -0
  210. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/caches/test_update_custom_url.py +0 -0
  211. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/chats/__init__.py +0 -0
  212. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/chats/test_get_history.py +0 -0
  213. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/chats/test_send_message.py +0 -0
  214. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/chats/test_validate_response.py +0 -0
  215. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/client/__init__.py +0 -0
  216. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/client/test_async_stream.py +0 -0
  217. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/client/test_client_close.py +0 -0
  218. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/client/test_client_initialization.py +0 -0
  219. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/client/test_client_requests.py +0 -0
  220. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/client/test_replay_client_equality.py +0 -0
  221. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/client/test_retries.py +0 -0
  222. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/client/test_upload_errors.py +0 -0
  223. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/common/__init__.py +0 -0
  224. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/common/test_common.py +0 -0
  225. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/conftest.py +0 -0
  226. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/documents/__init__.py +0 -0
  227. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/documents/test_delete.py +0 -0
  228. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/documents/test_get.py +0 -0
  229. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/documents/test_list.py +0 -0
  230. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/errors/__init__.py +0 -0
  231. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/errors/test_api_error.py +0 -0
  232. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/file_search_stores/__init__.py +0 -0
  233. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/file_search_stores/test_create.py +0 -0
  234. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/file_search_stores/test_delete.py +0 -0
  235. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/file_search_stores/test_get.py +0 -0
  236. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/file_search_stores/test_import_file.py +0 -0
  237. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/file_search_stores/test_list.py +0 -0
  238. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/file_search_stores/test_upload_to_file_search_store.py +0 -0
  239. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/files/__init__.py +0 -0
  240. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/files/test_delete.py +0 -0
  241. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/files/test_download.py +0 -0
  242. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/files/test_get.py +0 -0
  243. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/files/test_list.py +0 -0
  244. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/files/test_register.py +0 -0
  245. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/files/test_register_table.py +0 -0
  246. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/files/test_upload.py +0 -0
  247. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/imports/test_no_optional_imports.py +0 -0
  248. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/interactions/__init__.py +0 -0
  249. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/interactions/test_paths.py +0 -0
  250. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/live/__init__.py +0 -0
  251. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/live/test_live.py +0 -0
  252. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/live/test_live_music.py +0 -0
  253. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/live/test_live_response.py +0 -0
  254. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/live/test_send_client_content.py +0 -0
  255. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/live/test_send_realtime_input.py +0 -0
  256. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/live/test_send_tool_response.py +0 -0
  257. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/local_tokenizer/__init__.py +0 -0
  258. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/local_tokenizer/test_local_tokenizer.py +0 -0
  259. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/local_tokenizer/test_local_tokenizer_loader.py +0 -0
  260. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/mcp/__init__.py +0 -0
  261. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/mcp/test_has_mcp_tool_usage.py +0 -0
  262. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/mcp/test_mcp_to_gemini_tools.py +0 -0
  263. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/mcp/test_parse_config_for_mcp_sessions.py +0 -0
  264. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/mcp/test_parse_config_for_mcp_usage.py +0 -0
  265. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/mcp/test_set_mcp_usage_header.py +0 -0
  266. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/__init__.py +0 -0
  267. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/constants.py +0 -0
  268. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_compute_tokens.py +0 -0
  269. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_count_tokens.py +0 -0
  270. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_delete.py +0 -0
  271. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_edit_image.py +0 -0
  272. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_embed_content.py +0 -0
  273. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_function_call_streaming.py +0 -0
  274. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content.py +0 -0
  275. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_cached_content.py +0 -0
  276. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_config_zero_value.py +0 -0
  277. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_from_apikey.py +0 -0
  278. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_http_options.py +0 -0
  279. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_image_generation.py +0 -0
  280. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_mcp.py +0 -0
  281. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_media_resolution.py +0 -0
  282. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_model.py +0 -0
  283. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_part.py +0 -0
  284. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_thought.py +0 -0
  285. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_content_tools.py +0 -0
  286. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_images.py +0 -0
  287. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_generate_videos.py +0 -0
  288. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_get.py +0 -0
  289. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_list.py +0 -0
  290. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_recontext_image.py +0 -0
  291. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_segment_image.py +0 -0
  292. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_update.py +0 -0
  293. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/models/test_upscale_image.py +0 -0
  294. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/operations/__init__.py +0 -0
  295. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/operations/test_get.py +0 -0
  296. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/public_samples/__init__.py +0 -0
  297. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/public_samples/test_gemini_text_only.py +0 -0
  298. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/pytest_helper.py +0 -0
  299. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/__init__.py +0 -0
  300. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/batches/__init__.py +0 -0
  301. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/batches/test_create_delete.py +0 -0
  302. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/batches/test_create_get_cancel.py +0 -0
  303. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/batches/test_list.py +0 -0
  304. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/caches/__init__.py +0 -0
  305. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/caches/test_create_get_delete.py +0 -0
  306. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/caches/test_create_update_get.py +0 -0
  307. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/caches/test_list.py +0 -0
  308. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/chats/__init__.py +0 -0
  309. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/chats/test_send_message.py +0 -0
  310. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/chats/test_send_message_stream.py +0 -0
  311. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/files/__init__.py +0 -0
  312. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/files/test_list.py +0 -0
  313. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/files/test_upload_get_delete.py +0 -0
  314. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/__init__.py +0 -0
  315. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_compute_tokens.py +0 -0
  316. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_count_tokens.py +0 -0
  317. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_edit_image.py +0 -0
  318. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_embed.py +0 -0
  319. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_generate_content.py +0 -0
  320. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_generate_content_stream.py +0 -0
  321. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_generate_images.py +0 -0
  322. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_generate_videos.py +0 -0
  323. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_list.py +0 -0
  324. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_recontext_image.py +0 -0
  325. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_segment_image.py +0 -0
  326. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/models/test_upscale_image.py +0 -0
  327. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/tunings/__init__.py +0 -0
  328. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/tunings/test_create.py +0 -0
  329. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/tunings/test_create_get_cancel.py +0 -0
  330. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/shared/tunings/test_list.py +0 -0
  331. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/tokens/__init__.py +0 -0
  332. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/tokens/test_create.py +0 -0
  333. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/__init__.py +0 -0
  334. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_bytes.py +0 -0
  335. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_duck_type.py +0 -0
  336. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_function_responses.py +0 -0
  337. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_schema.py +0 -0
  338. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_t_batch.py +0 -0
  339. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_t_content.py +0 -0
  340. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_t_contents.py +0 -0
  341. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_t_part.py +0 -0
  342. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_t_parts.py +0 -0
  343. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_t_tool.py +0 -0
  344. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/transformers/test_t_tools.py +0 -0
  345. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/tunings/__init__.py +0 -0
  346. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/tunings/test_cancel.py +0 -0
  347. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/tunings/test_end_to_end.py +0 -0
  348. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/tunings/test_get.py +0 -0
  349. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/tunings/test_list.py +0 -0
  350. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/tunings/test_tune.py +0 -0
  351. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/types/__init__.py +0 -0
  352. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/types/test_bytes_internal.py +0 -0
  353. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/types/test_bytes_type.py +0 -0
  354. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/types/test_future.py +0 -0
  355. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/types/test_optional_types.py +0 -0
  356. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/types/test_part_type.py +0 -0
  357. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/types/test_schema_from_json_schema.py +0 -0
  358. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/types/test_schema_json_schema.py +0 -0
  359. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tests/types/test_types.py +0 -0
  360. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tokens.py +0 -0
  361. {google_genai-1.57.0 → google_genai-1.59.0}/google/genai/tunings.py +0 -0
  362. {google_genai-1.57.0 → google_genai-1.59.0}/google_genai.egg-info/dependency_links.txt +0 -0
  363. {google_genai-1.57.0 → google_genai-1.59.0}/google_genai.egg-info/top_level.txt +0 -0
  364. {google_genai-1.57.0 → google_genai-1.59.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-genai
3
- Version: 1.57.0
3
+ Version: 1.59.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.46.0
23
+ Requires-Dist: google-auth[requests]<3.0.0,>=2.47.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
@@ -112,7 +112,7 @@ Below is an example `generate_content()` call using types from the types module:
112
112
 
113
113
  ```python
114
114
  response = client.models.generate_content(
115
- model='gemini-2.0-flash-001',
115
+ model='gemini-2.5-flash',
116
116
  contents=types.Part.from_text(text='Why is the sky blue?'),
117
117
  config=types.GenerateContentConfig(
118
118
  temperature=0,
@@ -127,7 +127,7 @@ types:
127
127
 
128
128
  ```python
129
129
  response = client.models.generate_content(
130
- model='gemini-2.0-flash-001',
130
+ model='gemini-2.5-flash',
131
131
  contents={'text': 'Why is the sky blue?'},
132
132
  config={
133
133
  'temperature': 0,
@@ -621,7 +621,7 @@ and [Gemini API docs](https://ai.google.dev/gemini-api/docs/models) respectively
621
621
  from google.genai import types
622
622
 
623
623
  response = client.models.generate_content(
624
- model='gemini-2.0-flash-001',
624
+ model='gemini-2.5-flash',
625
625
  contents='high',
626
626
  config=types.GenerateContentConfig(
627
627
  system_instruction='I say high, you say low',
@@ -1238,7 +1238,6 @@ print(response)
1238
1238
  ```python
1239
1239
  from google.genai import types
1240
1240
 
1241
- # multiple contents with config
1242
1241
  response = client.models.embed_content(
1243
1242
  model='gemini-embedding-001',
1244
1243
  contents=['why is the sky blue?', 'What is your age?'],
@@ -1252,12 +1251,9 @@ print(response)
1252
1251
 
1253
1252
  #### Generate Images
1254
1253
 
1255
- Support for generate images in Gemini Developer API is behind an allowlist
1256
-
1257
1254
  ```python
1258
1255
  from google.genai import types
1259
1256
 
1260
- # Generate Image
1261
1257
  response1 = client.models.generate_images(
1262
1258
  model='imagen-4.0-generate-001',
1263
1259
  prompt='An umbrella in the foreground, and a rainy night sky in the background',
@@ -1277,7 +1273,6 @@ Upscale image is only supported in Vertex AI.
1277
1273
  ```python
1278
1274
  from google.genai import types
1279
1275
 
1280
- # Upscale the generated image from above
1281
1276
  response2 = client.models.upscale_image(
1282
1277
  model='imagen-4.0-upscale-preview',
1283
1278
  image=response1.generated_images[0].image,
@@ -1977,7 +1972,7 @@ file = client.files.upload(
1977
1972
 
1978
1973
  # Create a batch job with file name
1979
1974
  batch_job = client.batches.create(
1980
- model="gemini-2.0-flash",
1975
+ model="gemini-2.5-flash",
1981
1976
  src="files/test-json",
1982
1977
  )
1983
1978
  ```
@@ -74,7 +74,7 @@ Below is an example `generate_content()` call using types from the types module:
74
74
 
75
75
  ```python
76
76
  response = client.models.generate_content(
77
- model='gemini-2.0-flash-001',
77
+ model='gemini-2.5-flash',
78
78
  contents=types.Part.from_text(text='Why is the sky blue?'),
79
79
  config=types.GenerateContentConfig(
80
80
  temperature=0,
@@ -89,7 +89,7 @@ types:
89
89
 
90
90
  ```python
91
91
  response = client.models.generate_content(
92
- model='gemini-2.0-flash-001',
92
+ model='gemini-2.5-flash',
93
93
  contents={'text': 'Why is the sky blue?'},
94
94
  config={
95
95
  'temperature': 0,
@@ -583,7 +583,7 @@ and [Gemini API docs](https://ai.google.dev/gemini-api/docs/models) respectively
583
583
  from google.genai import types
584
584
 
585
585
  response = client.models.generate_content(
586
- model='gemini-2.0-flash-001',
586
+ model='gemini-2.5-flash',
587
587
  contents='high',
588
588
  config=types.GenerateContentConfig(
589
589
  system_instruction='I say high, you say low',
@@ -1200,7 +1200,6 @@ print(response)
1200
1200
  ```python
1201
1201
  from google.genai import types
1202
1202
 
1203
- # multiple contents with config
1204
1203
  response = client.models.embed_content(
1205
1204
  model='gemini-embedding-001',
1206
1205
  contents=['why is the sky blue?', 'What is your age?'],
@@ -1214,12 +1213,9 @@ print(response)
1214
1213
 
1215
1214
  #### Generate Images
1216
1215
 
1217
- Support for generate images in Gemini Developer API is behind an allowlist
1218
-
1219
1216
  ```python
1220
1217
  from google.genai import types
1221
1218
 
1222
- # Generate Image
1223
1219
  response1 = client.models.generate_images(
1224
1220
  model='imagen-4.0-generate-001',
1225
1221
  prompt='An umbrella in the foreground, and a rainy night sky in the background',
@@ -1239,7 +1235,6 @@ Upscale image is only supported in Vertex AI.
1239
1235
  ```python
1240
1236
  from google.genai import types
1241
1237
 
1242
- # Upscale the generated image from above
1243
1238
  response2 = client.models.upscale_image(
1244
1239
  model='imagen-4.0-upscale-preview',
1245
1240
  image=response1.generated_images[0].image,
@@ -1939,7 +1934,7 @@ file = client.files.upload(
1939
1934
 
1940
1935
  # Create a batch job with file name
1941
1936
  batch_job = client.batches.create(
1942
- model="gemini-2.0-flash",
1937
+ model="gemini-2.5-flash",
1943
1938
  src="files/test-json",
1944
1939
  )
1945
1940
  ```
@@ -181,6 +181,13 @@ def join_url_path(base_url: str, path: str) -> str:
181
181
 
182
182
  def load_auth(*, project: Union[str, None]) -> Tuple[Credentials, str]:
183
183
  """Loads google auth credentials and project id."""
184
+
185
+ ## Set GOOGLE_API_PREVENT_AGENT_TOKEN_SHARING_FOR_GCP_SERVICES to false
186
+ ## to disable bound token sharing. Tracking on
187
+ ## https://github.com/googleapis/python-genai/issues/1956
188
+ os.environ['GOOGLE_API_PREVENT_AGENT_TOKEN_SHARING_FOR_GCP_SERVICES'] = (
189
+ 'false'
190
+ )
184
191
  credentials, loaded_project_id = google.auth.default( # type: ignore[no-untyped-call]
185
192
  scopes=['https://www.googleapis.com/auth/cloud-platform'],
186
193
  )
@@ -715,19 +722,23 @@ class BaseApiClient:
715
722
  self._async_httpx_client = self._http_options.httpx_async_client
716
723
  else:
717
724
  self._async_httpx_client = AsyncHttpxClient(**async_client_args)
725
+
726
+ # Initialize the aiohttp client session.
727
+ self._aiohttp_session: Optional[aiohttp.ClientSession] = None
718
728
  if self._use_aiohttp():
719
729
  try:
720
730
  import aiohttp # pylint: disable=g-import-not-at-top
721
- # Do it once at the genai.Client level. Share among all requests.
722
- self._async_client_session_request_args = self._ensure_aiohttp_ssl_ctx(
723
- self._http_options
724
- )
731
+
732
+ if self._http_options.aiohttp_client:
733
+ self._aiohttp_session = self._http_options.aiohttp_client
734
+ else:
735
+ # Do it once at the genai.Client level. Share among all requests.
736
+ self._async_client_session_request_args = (
737
+ self._ensure_aiohttp_ssl_ctx(self._http_options)
738
+ )
725
739
  except ImportError:
726
740
  pass
727
741
 
728
- # Initialize the aiohttp client session.
729
- self._aiohttp_session: Optional[aiohttp.ClientSession] = None
730
-
731
742
  retry_kwargs = retry_args(self._http_options.retry_options)
732
743
  self._websocket_ssl_ctx = self._ensure_websocket_ssl_ctx(self._http_options)
733
744
  self._retry = tenacity.Retrying(**retry_kwargs)
@@ -1892,7 +1903,7 @@ class BaseApiClient:
1892
1903
  # close the client when the object is garbage collected.
1893
1904
  if not self._http_options.httpx_async_client:
1894
1905
  await self._async_httpx_client.aclose()
1895
- if self._aiohttp_session:
1906
+ if self._aiohttp_session and not self._http_options.aiohttp_client:
1896
1907
  await self._aiohttp_session.close()
1897
1908
 
1898
1909
  def __del__(self) -> None:
@@ -1942,5 +1953,3 @@ async def async_get_token_from_credentials(
1942
1953
  raise RuntimeError('Could not resolve API token from the environment')
1943
1954
 
1944
1955
  return credentials.token # type: ignore[no-any-return]
1945
-
1946
-
@@ -53,6 +53,7 @@ from ._exceptions import (
53
53
  )
54
54
  from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient
55
55
  from ._utils._logs import setup_logging as _setup_logging
56
+ from ._client_adapter import GeminiNextGenAPIClientAdapter, AsyncGeminiNextGenAPIClientAdapter
56
57
 
57
58
  __all__ = [
58
59
  "types",
@@ -96,6 +97,8 @@ __all__ = [
96
97
  "DefaultHttpxClient",
97
98
  "DefaultAsyncHttpxClient",
98
99
  "DefaultAioHttpClient",
100
+ "AsyncGeminiNextGenAPIClientAdapter",
101
+ "GeminiNextGenAPIClientAdapter"
99
102
  ]
100
103
 
101
104
  if not _t.TYPE_CHECKING:
@@ -24,6 +24,7 @@ import asyncio
24
24
  import inspect
25
25
  import logging
26
26
  import platform
27
+ import warnings
27
28
  import email.utils
28
29
  from types import TracebackType
29
30
  from random import random
@@ -66,9 +67,11 @@ from ._types import (
66
67
  ResponseT,
67
68
  AnyMapping,
68
69
  PostParser,
70
+ BinaryTypes,
69
71
  RequestFiles,
70
72
  HttpxSendArgs,
71
73
  RequestOptions,
74
+ AsyncBinaryTypes,
72
75
  HttpxRequestFiles,
73
76
  ModelBuilderProtocol,
74
77
  not_given,
@@ -501,8 +504,19 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
501
504
  retries_taken: int = 0,
502
505
  ) -> httpx.Request:
503
506
  if log.isEnabledFor(logging.DEBUG):
504
- log.debug("Request options: %s", model_dump(options, exclude_unset=True))
505
-
507
+ log.debug(
508
+ "Request options: %s",
509
+ model_dump(
510
+ options,
511
+ exclude_unset=True,
512
+ # Pydantic v1 can't dump every type we support in content, so we exclude it for now.
513
+ exclude={
514
+ "content",
515
+ }
516
+ if PYDANTIC_V1
517
+ else {},
518
+ ),
519
+ )
506
520
  kwargs: dict[str, Any] = {}
507
521
 
508
522
  json_data = options.json_data
@@ -556,7 +570,13 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
556
570
  is_body_allowed = options.method.lower() != "get"
557
571
 
558
572
  if is_body_allowed:
559
- if isinstance(json_data, bytes):
573
+ if options.content is not None and json_data is not None:
574
+ raise TypeError("Passing both `content` and `json_data` is not supported")
575
+ if options.content is not None and files is not None:
576
+ raise TypeError("Passing both `content` and `files` is not supported")
577
+ if options.content is not None:
578
+ kwargs["content"] = options.content
579
+ elif isinstance(json_data, bytes):
560
580
  kwargs["content"] = json_data
561
581
  else:
562
582
  kwargs["json"] = json_data if is_given(json_data) else None
@@ -1218,6 +1238,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1218
1238
  *,
1219
1239
  cast_to: Type[ResponseT],
1220
1240
  body: Body | None = None,
1241
+ content: BinaryTypes | None = None,
1221
1242
  options: RequestOptions = {},
1222
1243
  files: RequestFiles | None = None,
1223
1244
  stream: Literal[False] = False,
@@ -1230,6 +1251,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1230
1251
  *,
1231
1252
  cast_to: Type[ResponseT],
1232
1253
  body: Body | None = None,
1254
+ content: BinaryTypes | None = None,
1233
1255
  options: RequestOptions = {},
1234
1256
  files: RequestFiles | None = None,
1235
1257
  stream: Literal[True],
@@ -1243,6 +1265,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1243
1265
  *,
1244
1266
  cast_to: Type[ResponseT],
1245
1267
  body: Body | None = None,
1268
+ content: BinaryTypes | None = None,
1246
1269
  options: RequestOptions = {},
1247
1270
  files: RequestFiles | None = None,
1248
1271
  stream: bool,
@@ -1255,13 +1278,25 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1255
1278
  *,
1256
1279
  cast_to: Type[ResponseT],
1257
1280
  body: Body | None = None,
1281
+ content: BinaryTypes | None = None,
1258
1282
  options: RequestOptions = {},
1259
1283
  files: RequestFiles | None = None,
1260
1284
  stream: bool = False,
1261
1285
  stream_cls: type[_StreamT] | None = None,
1262
1286
  ) -> ResponseT | _StreamT:
1287
+ if body is not None and content is not None:
1288
+ raise TypeError("Passing both `body` and `content` is not supported")
1289
+ if files is not None and content is not None:
1290
+ raise TypeError("Passing both `files` and `content` is not supported")
1291
+ if isinstance(body, bytes):
1292
+ warnings.warn(
1293
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1294
+ "Please pass raw bytes via the `content` parameter instead.",
1295
+ DeprecationWarning,
1296
+ stacklevel=2,
1297
+ )
1263
1298
  opts = FinalRequestOptions.construct(
1264
- method="post", url=path, json_data=body, files=to_httpx_files(files), **options
1299
+ method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1265
1300
  )
1266
1301
  return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
1267
1302
 
@@ -1271,11 +1306,23 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1271
1306
  *,
1272
1307
  cast_to: Type[ResponseT],
1273
1308
  body: Body | None = None,
1309
+ content: BinaryTypes | None = None,
1274
1310
  files: RequestFiles | None = None,
1275
1311
  options: RequestOptions = {},
1276
1312
  ) -> ResponseT:
1313
+ if body is not None and content is not None:
1314
+ raise TypeError("Passing both `body` and `content` is not supported")
1315
+ if files is not None and content is not None:
1316
+ raise TypeError("Passing both `files` and `content` is not supported")
1317
+ if isinstance(body, bytes):
1318
+ warnings.warn(
1319
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1320
+ "Please pass raw bytes via the `content` parameter instead.",
1321
+ DeprecationWarning,
1322
+ stacklevel=2,
1323
+ )
1277
1324
  opts = FinalRequestOptions.construct(
1278
- method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
1325
+ method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1279
1326
  )
1280
1327
  return self.request(cast_to, opts)
1281
1328
 
@@ -1285,11 +1332,23 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1285
1332
  *,
1286
1333
  cast_to: Type[ResponseT],
1287
1334
  body: Body | None = None,
1335
+ content: BinaryTypes | None = None,
1288
1336
  files: RequestFiles | None = None,
1289
1337
  options: RequestOptions = {},
1290
1338
  ) -> ResponseT:
1339
+ if body is not None and content is not None:
1340
+ raise TypeError("Passing both `body` and `content` is not supported")
1341
+ if files is not None and content is not None:
1342
+ raise TypeError("Passing both `files` and `content` is not supported")
1343
+ if isinstance(body, bytes):
1344
+ warnings.warn(
1345
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1346
+ "Please pass raw bytes via the `content` parameter instead.",
1347
+ DeprecationWarning,
1348
+ stacklevel=2,
1349
+ )
1291
1350
  opts = FinalRequestOptions.construct(
1292
- method="put", url=path, json_data=body, files=to_httpx_files(files), **options
1351
+ method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
1293
1352
  )
1294
1353
  return self.request(cast_to, opts)
1295
1354
 
@@ -1299,9 +1358,19 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
1299
1358
  *,
1300
1359
  cast_to: Type[ResponseT],
1301
1360
  body: Body | None = None,
1361
+ content: BinaryTypes | None = None,
1302
1362
  options: RequestOptions = {},
1303
1363
  ) -> ResponseT:
1304
- opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options)
1364
+ if body is not None and content is not None:
1365
+ raise TypeError("Passing both `body` and `content` is not supported")
1366
+ if isinstance(body, bytes):
1367
+ warnings.warn(
1368
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1369
+ "Please pass raw bytes via the `content` parameter instead.",
1370
+ DeprecationWarning,
1371
+ stacklevel=2,
1372
+ )
1373
+ opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
1305
1374
  return self.request(cast_to, opts)
1306
1375
 
1307
1376
  def get_api_list(
@@ -1741,6 +1810,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1741
1810
  *,
1742
1811
  cast_to: Type[ResponseT],
1743
1812
  body: Body | None = None,
1813
+ content: AsyncBinaryTypes | None = None,
1744
1814
  files: RequestFiles | None = None,
1745
1815
  options: RequestOptions = {},
1746
1816
  stream: Literal[False] = False,
@@ -1753,6 +1823,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1753
1823
  *,
1754
1824
  cast_to: Type[ResponseT],
1755
1825
  body: Body | None = None,
1826
+ content: AsyncBinaryTypes | None = None,
1756
1827
  files: RequestFiles | None = None,
1757
1828
  options: RequestOptions = {},
1758
1829
  stream: Literal[True],
@@ -1766,6 +1837,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1766
1837
  *,
1767
1838
  cast_to: Type[ResponseT],
1768
1839
  body: Body | None = None,
1840
+ content: AsyncBinaryTypes | None = None,
1769
1841
  files: RequestFiles | None = None,
1770
1842
  options: RequestOptions = {},
1771
1843
  stream: bool,
@@ -1778,13 +1850,25 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1778
1850
  *,
1779
1851
  cast_to: Type[ResponseT],
1780
1852
  body: Body | None = None,
1853
+ content: AsyncBinaryTypes | None = None,
1781
1854
  files: RequestFiles | None = None,
1782
1855
  options: RequestOptions = {},
1783
1856
  stream: bool = False,
1784
1857
  stream_cls: type[_AsyncStreamT] | None = None,
1785
1858
  ) -> ResponseT | _AsyncStreamT:
1859
+ if body is not None and content is not None:
1860
+ raise TypeError("Passing both `body` and `content` is not supported")
1861
+ if files is not None and content is not None:
1862
+ raise TypeError("Passing both `files` and `content` is not supported")
1863
+ if isinstance(body, bytes):
1864
+ warnings.warn(
1865
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1866
+ "Please pass raw bytes via the `content` parameter instead.",
1867
+ DeprecationWarning,
1868
+ stacklevel=2,
1869
+ )
1786
1870
  opts = FinalRequestOptions.construct(
1787
- method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options
1871
+ method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
1788
1872
  )
1789
1873
  return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
1790
1874
 
@@ -1794,11 +1878,28 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1794
1878
  *,
1795
1879
  cast_to: Type[ResponseT],
1796
1880
  body: Body | None = None,
1881
+ content: AsyncBinaryTypes | None = None,
1797
1882
  files: RequestFiles | None = None,
1798
1883
  options: RequestOptions = {},
1799
1884
  ) -> ResponseT:
1885
+ if body is not None and content is not None:
1886
+ raise TypeError("Passing both `body` and `content` is not supported")
1887
+ if files is not None and content is not None:
1888
+ raise TypeError("Passing both `files` and `content` is not supported")
1889
+ if isinstance(body, bytes):
1890
+ warnings.warn(
1891
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1892
+ "Please pass raw bytes via the `content` parameter instead.",
1893
+ DeprecationWarning,
1894
+ stacklevel=2,
1895
+ )
1800
1896
  opts = FinalRequestOptions.construct(
1801
- method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options
1897
+ method="patch",
1898
+ url=path,
1899
+ json_data=body,
1900
+ content=content,
1901
+ files=await async_to_httpx_files(files),
1902
+ **options,
1802
1903
  )
1803
1904
  return await self.request(cast_to, opts)
1804
1905
 
@@ -1808,11 +1909,23 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1808
1909
  *,
1809
1910
  cast_to: Type[ResponseT],
1810
1911
  body: Body | None = None,
1912
+ content: AsyncBinaryTypes | None = None,
1811
1913
  files: RequestFiles | None = None,
1812
1914
  options: RequestOptions = {},
1813
1915
  ) -> ResponseT:
1916
+ if body is not None and content is not None:
1917
+ raise TypeError("Passing both `body` and `content` is not supported")
1918
+ if files is not None and content is not None:
1919
+ raise TypeError("Passing both `files` and `content` is not supported")
1920
+ if isinstance(body, bytes):
1921
+ warnings.warn(
1922
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1923
+ "Please pass raw bytes via the `content` parameter instead.",
1924
+ DeprecationWarning,
1925
+ stacklevel=2,
1926
+ )
1814
1927
  opts = FinalRequestOptions.construct(
1815
- method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options
1928
+ method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
1816
1929
  )
1817
1930
  return await self.request(cast_to, opts)
1818
1931
 
@@ -1822,9 +1935,19 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1822
1935
  *,
1823
1936
  cast_to: Type[ResponseT],
1824
1937
  body: Body | None = None,
1938
+ content: AsyncBinaryTypes | None = None,
1825
1939
  options: RequestOptions = {},
1826
1940
  ) -> ResponseT:
1827
- opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options)
1941
+ if body is not None and content is not None:
1942
+ raise TypeError("Passing both `body` and `content` is not supported")
1943
+ if isinstance(body, bytes):
1944
+ warnings.warn(
1945
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
1946
+ "Please pass raw bytes via the `content` parameter instead.",
1947
+ DeprecationWarning,
1948
+ stacklevel=2,
1949
+ )
1950
+ opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
1828
1951
  return await self.request(cast_to, opts)
1829
1952
 
1830
1953
  def get_api_list(