google-genai 1.25.0__tar.gz → 1.26.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 (43) hide show
  1. {google_genai-1.25.0/google_genai.egg-info → google_genai-1.26.0}/PKG-INFO +44 -10
  2. {google_genai-1.25.0 → google_genai-1.26.0}/README.md +43 -9
  3. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_extra_utils.py +1 -1
  4. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_live_converters.py +1624 -1922
  5. google_genai-1.26.0/google/genai/_tokens_converters.py +817 -0
  6. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_transformers.py +21 -11
  7. google_genai-1.26.0/google/genai/batches.py +2679 -0
  8. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/caches.py +0 -65
  9. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/files.py +4 -0
  10. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/live.py +8 -10
  11. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/models.py +10 -170
  12. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/operations.py +36 -266
  13. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/tunings.py +7 -46
  14. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/types.py +109 -46
  15. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/version.py +1 -1
  16. {google_genai-1.25.0 → google_genai-1.26.0/google_genai.egg-info}/PKG-INFO +44 -10
  17. {google_genai-1.25.0 → google_genai-1.26.0}/pyproject.toml +1 -1
  18. google_genai-1.25.0/google/genai/_tokens_converters.py +0 -1680
  19. google_genai-1.25.0/google/genai/batches.py +0 -5768
  20. {google_genai-1.25.0 → google_genai-1.26.0}/LICENSE +0 -0
  21. {google_genai-1.25.0 → google_genai-1.26.0}/MANIFEST.in +0 -0
  22. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/__init__.py +0 -0
  23. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_adapters.py +0 -0
  24. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_api_client.py +0 -0
  25. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_api_module.py +0 -0
  26. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_automatic_function_calling_util.py +0 -0
  27. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_base_url.py +0 -0
  28. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_common.py +0 -0
  29. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_mcp_utils.py +0 -0
  30. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_replay_api_client.py +0 -0
  31. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/_test_api_client.py +0 -0
  32. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/chats.py +0 -0
  33. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/client.py +0 -0
  34. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/errors.py +0 -0
  35. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/live_music.py +0 -0
  36. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/pagers.py +0 -0
  37. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/py.typed +0 -0
  38. {google_genai-1.25.0 → google_genai-1.26.0}/google/genai/tokens.py +0 -0
  39. {google_genai-1.25.0 → google_genai-1.26.0}/google_genai.egg-info/SOURCES.txt +0 -0
  40. {google_genai-1.25.0 → google_genai-1.26.0}/google_genai.egg-info/dependency_links.txt +0 -0
  41. {google_genai-1.25.0 → google_genai-1.26.0}/google_genai.egg-info/requires.txt +0 -0
  42. {google_genai-1.25.0 → google_genai-1.26.0}/google_genai.egg-info/top_level.txt +0 -0
  43. {google_genai-1.25.0 → google_genai-1.26.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-genai
3
- Version: 1.25.0
3
+ Version: 1.26.0
4
4
  Summary: GenAI Python SDK
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache-2.0
@@ -609,16 +609,16 @@ from google.genai import types
609
609
  function = types.FunctionDeclaration(
610
610
  name='get_current_weather',
611
611
  description='Get the current weather in a given location',
612
- parameters=types.Schema(
613
- type='OBJECT',
614
- properties={
615
- 'location': types.Schema(
616
- type='STRING',
617
- description='The city and state, e.g. San Francisco, CA',
618
- ),
612
+ parameters_json_schema={
613
+ 'type': 'object',
614
+ 'properties': {
615
+ 'location': {
616
+ 'type': 'string',
617
+ 'description': 'The city and state, e.g. San Francisco, CA',
618
+ }
619
619
  },
620
- required=['location'],
621
- ),
620
+ 'required': ['location'],
621
+ },
622
622
  )
623
623
 
624
624
  tool = types.Tool(function_declarations=[function])
@@ -799,6 +799,40 @@ However you define your schema, don't duplicate it in your input prompt,
799
799
  including by giving examples of expected JSON output. If you do, the generated
800
800
  output might be lower in quality.
801
801
 
802
+ #### JSON Schema support
803
+ Schemas can be provided as standard JSON schema.
804
+ ```python
805
+ user_profile = {
806
+ 'properties': {
807
+ 'age': {
808
+ 'anyOf': [
809
+ {'maximum': 20, 'minimum': 0, 'type': 'integer'},
810
+ {'type': 'null'},
811
+ ],
812
+ 'title': 'Age',
813
+ },
814
+ 'username': {
815
+ 'description': "User's unique name",
816
+ 'title': 'Username',
817
+ 'type': 'string',
818
+ },
819
+ },
820
+ 'required': ['username', 'age'],
821
+ 'title': 'User Schema',
822
+ 'type': 'object',
823
+ }
824
+
825
+ response = client.models.generate_content(
826
+ model='gemini-2.0-flash',
827
+ contents='Give me information of the United States.',
828
+ config={
829
+ 'response_mime_type': 'application/json',
830
+ 'response_json_schema': userProfile
831
+ },
832
+ )
833
+ print(response.parsed)
834
+ ```
835
+
802
836
  #### Pydantic Model Schema support
803
837
 
804
838
  Schemas can be provided as Pydantic Models.
@@ -575,16 +575,16 @@ from google.genai import types
575
575
  function = types.FunctionDeclaration(
576
576
  name='get_current_weather',
577
577
  description='Get the current weather in a given location',
578
- parameters=types.Schema(
579
- type='OBJECT',
580
- properties={
581
- 'location': types.Schema(
582
- type='STRING',
583
- description='The city and state, e.g. San Francisco, CA',
584
- ),
578
+ parameters_json_schema={
579
+ 'type': 'object',
580
+ 'properties': {
581
+ 'location': {
582
+ 'type': 'string',
583
+ 'description': 'The city and state, e.g. San Francisco, CA',
584
+ }
585
585
  },
586
- required=['location'],
587
- ),
586
+ 'required': ['location'],
587
+ },
588
588
  )
589
589
 
590
590
  tool = types.Tool(function_declarations=[function])
@@ -765,6 +765,40 @@ However you define your schema, don't duplicate it in your input prompt,
765
765
  including by giving examples of expected JSON output. If you do, the generated
766
766
  output might be lower in quality.
767
767
 
768
+ #### JSON Schema support
769
+ Schemas can be provided as standard JSON schema.
770
+ ```python
771
+ user_profile = {
772
+ 'properties': {
773
+ 'age': {
774
+ 'anyOf': [
775
+ {'maximum': 20, 'minimum': 0, 'type': 'integer'},
776
+ {'type': 'null'},
777
+ ],
778
+ 'title': 'Age',
779
+ },
780
+ 'username': {
781
+ 'description': "User's unique name",
782
+ 'title': 'Username',
783
+ 'type': 'string',
784
+ },
785
+ },
786
+ 'required': ['username', 'age'],
787
+ 'title': 'User Schema',
788
+ 'type': 'object',
789
+ }
790
+
791
+ response = client.models.generate_content(
792
+ model='gemini-2.0-flash',
793
+ contents='Give me information of the United States.',
794
+ config={
795
+ 'response_mime_type': 'application/json',
796
+ 'response_json_schema': userProfile
797
+ },
798
+ )
799
+ print(response.parsed)
800
+ ```
801
+
768
802
  #### Pydantic Model Schema support
769
803
 
770
804
  Schemas can be provided as Pydantic Models.
@@ -114,7 +114,7 @@ def format_destination(
114
114
  unique_name = unique_name or _common.timestamped_unique_name()
115
115
  config.dest = f'{bigquery_source_uri}_dest_{unique_name}'
116
116
  else:
117
- raise ValueError(f'Unsupported source: {src}')
117
+ raise ValueError(f'The source {src} is not supported.')
118
118
  return config
119
119
 
120
120