google-genai 0.6.0__py3-none-any.whl → 0.7.0__py3-none-any.whl

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/types.py CHANGED
@@ -16,15 +16,32 @@
16
16
  # Code generated by the Google Gen AI SDK generator DO NOT EDIT.
17
17
 
18
18
  import datetime
19
+ from enum import Enum, EnumMeta
19
20
  import inspect
20
21
  import json
21
22
  import logging
22
- from typing import Any, Callable, GenericAlias, Literal, Optional, TypedDict, Union
23
- import PIL.Image
23
+ import typing
24
+ from typing import Any, Callable, GenericAlias, Literal, Optional, Type, TypedDict, Union
24
25
  import pydantic
25
26
  from pydantic import Field
26
27
  from . import _common
27
28
 
29
+ _is_pillow_image_imported = False
30
+ if typing.TYPE_CHECKING:
31
+ import PIL.Image
32
+
33
+ PIL_Image = PIL.Image.Image
34
+ _is_pillow_image_imported = True
35
+ else:
36
+ PIL_Image: Type = Any
37
+ try:
38
+ import PIL.Image
39
+
40
+ PIL_Image = PIL.Image.Image
41
+ _is_pillow_image_imported = True
42
+ except ImportError:
43
+ PIL_Image = None
44
+
28
45
 
29
46
  class Outcome(_common.CaseInSensitiveEnum):
30
47
  """Required. Outcome of the code execution."""
@@ -164,7 +181,7 @@ class DeploymentResourcesType(_common.CaseInSensitiveEnum):
164
181
 
165
182
 
166
183
  class JobState(_common.CaseInSensitiveEnum):
167
- """Config class for the job state."""
184
+ """Job state."""
168
185
 
169
186
  JOB_STATE_UNSPECIFIED = 'JOB_STATE_UNSPECIFIED'
170
187
  JOB_STATE_QUEUED = 'JOB_STATE_QUEUED'
@@ -192,14 +209,14 @@ class AdapterSize(_common.CaseInSensitiveEnum):
192
209
 
193
210
 
194
211
  class DynamicRetrievalConfigMode(_common.CaseInSensitiveEnum):
195
- """Config class for the dynamic retrieval config mode."""
212
+ """Config for the dynamic retrieval config mode."""
196
213
 
197
214
  MODE_UNSPECIFIED = 'MODE_UNSPECIFIED'
198
215
  MODE_DYNAMIC = 'MODE_DYNAMIC'
199
216
 
200
217
 
201
218
  class FunctionCallingConfigMode(_common.CaseInSensitiveEnum):
202
- """Config class for the function calling config mode."""
219
+ """Config for the function calling config mode."""
203
220
 
204
221
  MODE_UNSPECIFIED = 'MODE_UNSPECIFIED'
205
222
  AUTO = 'AUTO'
@@ -302,7 +319,7 @@ class FileSource(_common.CaseInSensitiveEnum):
302
319
 
303
320
 
304
321
  class Modality(_common.CaseInSensitiveEnum):
305
- """Config class for the server content modalities."""
322
+ """Server content modalities."""
306
323
 
307
324
  MODALITY_UNSPECIFIED = 'MODALITY_UNSPECIFIED'
308
325
  TEXT = 'TEXT'
@@ -494,10 +511,7 @@ FunctionResponseOrDict = Union[FunctionResponse, FunctionResponseDict]
494
511
 
495
512
 
496
513
  class Blob(_common.BaseModel):
497
- """Content blob.
498
-
499
- It's preferred to send as text directly rather than raw bytes.
500
- """
514
+ """Content blob."""
501
515
 
502
516
  data: Optional[bytes] = Field(
503
517
  default=None, description="""Required. Raw bytes."""
@@ -509,10 +523,7 @@ class Blob(_common.BaseModel):
509
523
 
510
524
 
511
525
  class BlobDict(TypedDict, total=False):
512
- """Content blob.
513
-
514
- It's preferred to send as text directly rather than raw bytes.
515
- """
526
+ """Content blob."""
516
527
 
517
528
  data: Optional[bytes]
518
529
  """Required. Raw bytes."""
@@ -566,16 +577,16 @@ class Part(_common.BaseModel):
566
577
  )
567
578
 
568
579
  @classmethod
569
- def from_uri(cls, file_uri: str, mime_type: str) -> 'Part':
580
+ def from_uri(cls, *, file_uri: str, mime_type: str) -> 'Part':
570
581
  file_data = FileData(file_uri=file_uri, mime_type=mime_type)
571
582
  return cls(file_data=file_data)
572
583
 
573
584
  @classmethod
574
- def from_text(cls, text: str) -> 'Part':
585
+ def from_text(cls, *, text: str) -> 'Part':
575
586
  return cls(text=text)
576
587
 
577
588
  @classmethod
578
- def from_bytes(cls, data: bytes, mime_type: str) -> 'Part':
589
+ def from_bytes(cls, *, data: bytes, mime_type: str) -> 'Part':
579
590
  inline_data = Blob(
580
591
  data=data,
581
592
  mime_type=mime_type,
@@ -583,31 +594,33 @@ class Part(_common.BaseModel):
583
594
  return cls(inline_data=inline_data)
584
595
 
585
596
  @classmethod
586
- def from_function_call(cls, name: str, args: dict[str, Any]) -> 'Part':
597
+ def from_function_call(cls, *, name: str, args: dict[str, Any]) -> 'Part':
587
598
  function_call = FunctionCall(name=name, args=args)
588
599
  return cls(function_call=function_call)
589
600
 
590
601
  @classmethod
591
602
  def from_function_response(
592
- cls, name: str, response: dict[str, Any]
603
+ cls, *, name: str, response: dict[str, Any]
593
604
  ) -> 'Part':
594
605
  function_response = FunctionResponse(name=name, response=response)
595
606
  return cls(function_response=function_response)
596
607
 
597
608
  @classmethod
598
- def from_video_metadata(cls, end_offset: str, start_offset: str) -> 'Part':
609
+ def from_video_metadata(cls, *, start_offset: str, end_offset: str) -> 'Part':
599
610
  video_metadata = VideoMetadata(
600
611
  end_offset=end_offset, start_offset=start_offset
601
612
  )
602
613
  return cls(video_metadata=video_metadata)
603
614
 
604
615
  @classmethod
605
- def from_executable_code(cls, code: str, language: Language) -> 'Part':
616
+ def from_executable_code(cls, *, code: str, language: Language) -> 'Part':
606
617
  executable_code = ExecutableCode(code=code, language=language)
607
618
  return cls(executable_code=executable_code)
608
619
 
609
620
  @classmethod
610
- def from_code_execution_result(cls, outcome: Outcome, output: str) -> 'Part':
621
+ def from_code_execution_result(
622
+ cls, *, outcome: Outcome, output: str
623
+ ) -> 'Part':
611
624
  code_execution_result = CodeExecutionResult(outcome=outcome, output=output)
612
625
  return cls(code_execution_result=code_execution_result)
613
626
 
@@ -683,6 +696,51 @@ class ContentDict(TypedDict, total=False):
683
696
  ContentOrDict = Union[Content, ContentDict]
684
697
 
685
698
 
699
+ class HttpOptions(_common.BaseModel):
700
+ """HTTP options to be used in each of the requests."""
701
+
702
+ base_url: Optional[str] = Field(
703
+ default=None,
704
+ description="""The base URL for the AI platform service endpoint.""",
705
+ )
706
+ api_version: Optional[str] = Field(
707
+ default=None, description="""Specifies the version of the API to use."""
708
+ )
709
+ headers: Optional[dict[str, str]] = Field(
710
+ default=None,
711
+ description="""Additional HTTP headers to be sent with the request.""",
712
+ )
713
+ timeout: Optional[int] = Field(
714
+ default=None, description="""Timeout for the request in milliseconds."""
715
+ )
716
+ deprecated_response_payload: Optional[dict[str, any]] = Field(
717
+ default=None,
718
+ description="""This field is deprecated. If set, the response payload will be returned int the supplied dict.""",
719
+ )
720
+
721
+
722
+ class HttpOptionsDict(TypedDict, total=False):
723
+ """HTTP options to be used in each of the requests."""
724
+
725
+ base_url: Optional[str]
726
+ """The base URL for the AI platform service endpoint."""
727
+
728
+ api_version: Optional[str]
729
+ """Specifies the version of the API to use."""
730
+
731
+ headers: Optional[dict[str, str]]
732
+ """Additional HTTP headers to be sent with the request."""
733
+
734
+ timeout: Optional[int]
735
+ """Timeout for the request in milliseconds."""
736
+
737
+ deprecated_response_payload: Optional[dict[str, any]]
738
+ """This field is deprecated. If set, the response payload will be returned int the supplied dict."""
739
+
740
+
741
+ HttpOptionsOrDict = Union[HttpOptions, HttpOptionsDict]
742
+
743
+
686
744
  class Schema(_common.BaseModel):
687
745
  """Schema that defines the format of input and output data.
688
746
 
@@ -910,88 +968,61 @@ class FunctionDeclaration(_common.BaseModel):
910
968
  )
911
969
 
912
970
  @classmethod
913
- def _get_variant(cls, client) -> str:
914
- """Returns the function variant based on the provided client object."""
915
- if client.vertexai:
916
- return 'VERTEX_AI'
917
- else:
918
- return 'GOOGLE_AI'
919
-
920
- @classmethod
921
- def from_function_with_options(
971
+ def from_callable(
922
972
  cls,
923
- func: Callable,
924
- variant: Literal['GOOGLE_AI', 'VERTEX_AI', 'DEFAULT'] = 'GOOGLE_AI',
973
+ *,
974
+ client,
975
+ callable: Callable,
925
976
  ) -> 'FunctionDeclaration':
926
- """Converts a function to a FunctionDeclaration based on an API endpoint.
927
-
928
- Supported endpoints are: 'GOOGLE_AI', 'VERTEX_AI', or 'DEFAULT'.
929
- """
977
+ """Converts a Callable to a FunctionDeclaration based on the client."""
930
978
  from . import _automatic_function_calling_util
931
979
 
932
- supported_variants = ['GOOGLE_AI', 'VERTEX_AI', 'DEFAULT']
933
- if variant not in supported_variants:
934
- raise ValueError(
935
- f'Unsupported variant: {variant}. Supported variants are:'
936
- f' {", ".join(supported_variants)}'
937
- )
938
-
939
- # TODO: b/382524014 - Add support for DEFAULT API endpoint.
940
-
941
980
  parameters_properties = {}
942
- for name, param in inspect.signature(func).parameters.items():
981
+ for name, param in inspect.signature(callable).parameters.items():
943
982
  if param.kind in (
944
983
  inspect.Parameter.POSITIONAL_OR_KEYWORD,
945
984
  inspect.Parameter.KEYWORD_ONLY,
946
985
  inspect.Parameter.POSITIONAL_ONLY,
947
986
  ):
948
987
  schema = _automatic_function_calling_util._parse_schema_from_parameter(
949
- variant, param, func.__name__
988
+ client, param, callable.__name__
950
989
  )
951
990
  parameters_properties[name] = schema
952
991
  declaration = FunctionDeclaration(
953
- name=func.__name__,
954
- description=func.__doc__,
992
+ name=callable.__name__,
993
+ description=callable.__doc__,
955
994
  )
956
995
  if parameters_properties:
957
996
  declaration.parameters = Schema(
958
997
  type='OBJECT',
959
998
  properties=parameters_properties,
960
999
  )
961
- if variant == 'VERTEX_AI':
1000
+ if client.vertexai:
962
1001
  declaration.parameters.required = (
963
1002
  _automatic_function_calling_util._get_required_fields(
964
1003
  declaration.parameters
965
1004
  )
966
1005
  )
967
- if not variant == 'VERTEX_AI':
1006
+ if not client.vertexai:
968
1007
  return declaration
969
1008
 
970
- return_annotation = inspect.signature(func).return_annotation
1009
+ return_annotation = inspect.signature(callable).return_annotation
971
1010
  if return_annotation is inspect._empty:
972
1011
  return declaration
973
1012
 
974
1013
  declaration.response = (
975
1014
  _automatic_function_calling_util._parse_schema_from_parameter(
976
- variant,
1015
+ client,
977
1016
  inspect.Parameter(
978
1017
  'return_value',
979
1018
  inspect.Parameter.POSITIONAL_OR_KEYWORD,
980
1019
  annotation=return_annotation,
981
1020
  ),
982
- func.__name__,
1021
+ callable.__name__,
983
1022
  )
984
1023
  )
985
1024
  return declaration
986
1025
 
987
- @classmethod
988
- def from_callable(cls, client, func: Callable) -> 'FunctionDeclaration':
989
- """Converts a function to a FunctionDeclaration."""
990
- return cls.from_function_with_options(
991
- variant=cls._get_variant(client),
992
- func=func,
993
- )
994
-
995
1026
 
996
1027
  class FunctionDeclarationDict(TypedDict, total=False):
997
1028
  """Defines a function that the model can generate JSON inputs for.
@@ -1610,8 +1641,10 @@ class FileDict(TypedDict, total=False):
1610
1641
 
1611
1642
  FileOrDict = Union[File, FileDict]
1612
1643
 
1613
-
1614
- PartUnion = Union[File, Part, PIL.Image.Image, str]
1644
+ if _is_pillow_image_imported:
1645
+ PartUnion = Union[File, Part, PIL_Image, str]
1646
+ else:
1647
+ PartUnion = Union[File, Part, str]
1615
1648
 
1616
1649
 
1617
1650
  PartUnionDict = Union[PartUnion, PartDict]
@@ -1709,12 +1742,15 @@ SpeechConfigUnionDict = Union[SpeechConfigUnion, SpeechConfigDict]
1709
1742
 
1710
1743
 
1711
1744
  class GenerateContentConfig(_common.BaseModel):
1712
- """Class for configuring optional model parameters.
1745
+ """Optional model configuration parameters.
1713
1746
 
1714
1747
  For more information, see `Content generation parameters
1715
1748
  <https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters>`_.
1716
1749
  """
1717
1750
 
1751
+ http_options: Optional[HttpOptions] = Field(
1752
+ default=None, description="""Used to override HTTP request options."""
1753
+ )
1718
1754
  system_instruction: Optional[ContentUnion] = Field(
1719
1755
  default=None,
1720
1756
  description="""Instructions for the model to steer it toward better performance.
@@ -1868,12 +1904,15 @@ class GenerateContentConfig(_common.BaseModel):
1868
1904
 
1869
1905
 
1870
1906
  class GenerateContentConfigDict(TypedDict, total=False):
1871
- """Class for configuring optional model parameters.
1907
+ """Optional model configuration parameters.
1872
1908
 
1873
1909
  For more information, see `Content generation parameters
1874
1910
  <https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters>`_.
1875
1911
  """
1876
1912
 
1913
+ http_options: Optional[HttpOptionsDict]
1914
+ """Used to override HTTP request options."""
1915
+
1877
1916
  system_instruction: Optional[ContentUnionDict]
1878
1917
  """Instructions for the model to steer it toward better performance.
1879
1918
  For example, "Answer as concisely as possible" or "Don't use technical
@@ -2012,7 +2051,7 @@ ContentListUnionDict = Union[list[ContentUnionDict], ContentUnionDict]
2012
2051
 
2013
2052
 
2014
2053
  class _GenerateContentParameters(_common.BaseModel):
2015
- """Class for configuring the content of the request to the model."""
2054
+ """Config for models.generate_content parameters."""
2016
2055
 
2017
2056
  model: Optional[str] = Field(
2018
2057
  default=None,
@@ -2032,7 +2071,7 @@ class _GenerateContentParameters(_common.BaseModel):
2032
2071
 
2033
2072
 
2034
2073
  class _GenerateContentParametersDict(TypedDict, total=False):
2035
- """Class for configuring the content of the request to the model."""
2074
+ """Config for models.generate_content parameters."""
2036
2075
 
2037
2076
  model: Optional[str]
2038
2077
  """ID of the model to use. For a list of models, see `Google models
@@ -2154,7 +2193,7 @@ CitationOrDict = Union[Citation, CitationDict]
2154
2193
 
2155
2194
 
2156
2195
  class CitationMetadata(_common.BaseModel):
2157
- """Class for citation information when the model quotes another source."""
2196
+ """Citation information when the model quotes another source."""
2158
2197
 
2159
2198
  citations: Optional[list[Citation]] = Field(
2160
2199
  default=None,
@@ -2166,7 +2205,7 @@ class CitationMetadata(_common.BaseModel):
2166
2205
 
2167
2206
 
2168
2207
  class CitationMetadataDict(TypedDict, total=False):
2169
- """Class for citation information when the model quotes another source."""
2208
+ """Citation information when the model quotes another source."""
2170
2209
 
2171
2210
  citations: Optional[list[CitationDict]]
2172
2211
  """Contains citation information when the model directly quotes, at
@@ -2559,7 +2598,7 @@ SafetyRatingOrDict = Union[SafetyRating, SafetyRatingDict]
2559
2598
 
2560
2599
 
2561
2600
  class Candidate(_common.BaseModel):
2562
- """Class containing a response candidate generated from the model."""
2601
+ """A response candidate generated from the model."""
2563
2602
 
2564
2603
  content: Optional[Content] = Field(
2565
2604
  default=None,
@@ -2607,7 +2646,7 @@ class Candidate(_common.BaseModel):
2607
2646
 
2608
2647
 
2609
2648
  class CandidateDict(TypedDict, total=False):
2610
- """Class containing a response candidate generated from the model."""
2649
+ """A response candidate generated from the model."""
2611
2650
 
2612
2651
  content: Optional[ContentDict]
2613
2652
  """Contains the multi-part content of the response.
@@ -2743,7 +2782,7 @@ class GenerateContentResponse(_common.BaseModel):
2743
2782
  default=None, description="""Usage metadata about the response(s)."""
2744
2783
  )
2745
2784
  automatic_function_calling_history: Optional[list[Content]] = None
2746
- parsed: Union[pydantic.BaseModel, dict] = Field(
2785
+ parsed: Union[pydantic.BaseModel, dict, Enum] = Field(
2747
2786
  default=None,
2748
2787
  description="""Parsed response if response_schema is provided. Not available for streaming.""",
2749
2788
  )
@@ -2806,7 +2845,7 @@ class GenerateContentResponse(_common.BaseModel):
2806
2845
 
2807
2846
  @classmethod
2808
2847
  def _from_response(
2809
- cls, response: dict[str, object], kwargs: dict[str, object]
2848
+ cls, *, response: dict[str, object], kwargs: dict[str, object]
2810
2849
  ):
2811
2850
  result = super()._from_response(response, kwargs)
2812
2851
 
@@ -2814,8 +2853,12 @@ class GenerateContentResponse(_common.BaseModel):
2814
2853
  response_schema = _common.get_value_by_path(
2815
2854
  kwargs, ['config', 'response_schema']
2816
2855
  )
2817
- if inspect.isclass(response_schema) and issubclass(
2818
- response_schema, pydantic.BaseModel
2856
+ if (
2857
+ inspect.isclass(response_schema)
2858
+ and not (
2859
+ isinstance(response_schema, GenericAlias)
2860
+ ) # Needed for Python 3.9 and 3.10
2861
+ and issubclass(response_schema, pydantic.BaseModel)
2819
2862
  ):
2820
2863
  # Pydantic schema.
2821
2864
  try:
@@ -2823,27 +2866,36 @@ class GenerateContentResponse(_common.BaseModel):
2823
2866
  # may not be a valid json per stream response
2824
2867
  except pydantic.ValidationError:
2825
2868
  pass
2826
-
2827
- elif isinstance(response_schema, GenericAlias) and issubclass(
2828
- response_schema.__args__[0], pydantic.BaseModel
2869
+ except json.decoder.JSONDecodeError:
2870
+ pass
2871
+ elif isinstance(response_schema, EnumMeta):
2872
+ # Enum with "application/json" returns response in double quotes.
2873
+ enum_value = result.text.replace('"', '')
2874
+ try:
2875
+ result.parsed = response_schema(enum_value)
2876
+ except ValueError:
2877
+ pass
2878
+ elif isinstance(response_schema, GenericAlias) or isinstance(
2879
+ response_schema, type
2829
2880
  ):
2830
- # Handle cases where `list[pydantic.BaseModel]` was provided.
2831
- result.parsed = []
2832
- pydantic_model_class = response_schema.__args__[0]
2833
- response_list_json = json.loads(result.text)
2834
- for json_instance in response_list_json:
2835
- try:
2836
- pydantic_model_instance = pydantic_model_class.model_validate_json(
2837
- json.dumps(json_instance)
2838
- )
2839
- result.parsed.append(pydantic_model_instance)
2840
- # may not be a valid json per stream response
2841
- except pydantic.ValidationError:
2842
- pass
2881
+
2882
+ class Placeholder(pydantic.BaseModel):
2883
+ placeholder: response_schema
2884
+
2885
+ try:
2886
+ parsed = {'placeholder': json.loads(result.text)}
2887
+ placeholder = Placeholder.model_validate(parsed)
2888
+ result.parsed = placeholder.placeholder
2889
+ except json.decoder.JSONDecodeError:
2890
+ pass
2891
+ except pydantic.ValidationError:
2892
+ pass
2843
2893
 
2844
2894
  elif isinstance(response_schema, dict) or isinstance(
2845
- response_schema, pydantic.BaseModel
2895
+ response_schema, Schema
2846
2896
  ):
2897
+ # With just the Schema, we don't know what pydantic model the user would
2898
+ # want the result converted to. So just return json.
2847
2899
  # JSON schema.
2848
2900
  try:
2849
2901
  result.parsed = json.loads(result.text)
@@ -2877,9 +2929,9 @@ GenerateContentResponseOrDict = Union[
2877
2929
 
2878
2930
 
2879
2931
  class EmbedContentConfig(_common.BaseModel):
2880
- """Class for configuring optional parameters for the embed_content method."""
2932
+ """Optional parameters for the embed_content method."""
2881
2933
 
2882
- http_options: Optional[dict[str, Any]] = Field(
2934
+ http_options: Optional[HttpOptions] = Field(
2883
2935
  default=None, description="""Used to override HTTP request options."""
2884
2936
  )
2885
2937
  task_type: Optional[str] = Field(
@@ -2916,9 +2968,9 @@ class EmbedContentConfig(_common.BaseModel):
2916
2968
 
2917
2969
 
2918
2970
  class EmbedContentConfigDict(TypedDict, total=False):
2919
- """Class for configuring optional parameters for the embed_content method."""
2971
+ """Optional parameters for the embed_content method."""
2920
2972
 
2921
- http_options: Optional[dict[str, Any]]
2973
+ http_options: Optional[HttpOptionsDict]
2922
2974
  """Used to override HTTP request options."""
2923
2975
 
2924
2976
  task_type: Optional[str]
@@ -3117,10 +3169,10 @@ EmbedContentResponseOrDict = Union[
3117
3169
  ]
3118
3170
 
3119
3171
 
3120
- class GenerateImageConfig(_common.BaseModel):
3121
- """Class that represents the config for generating an image."""
3172
+ class GenerateImagesConfig(_common.BaseModel):
3173
+ """The config for generating an images."""
3122
3174
 
3123
- http_options: Optional[dict[str, Any]] = Field(
3175
+ http_options: Optional[HttpOptions] = Field(
3124
3176
  default=None, description="""Used to override HTTP request options."""
3125
3177
  )
3126
3178
  output_gcs_uri: Optional[str] = Field(
@@ -3190,20 +3242,25 @@ class GenerateImageConfig(_common.BaseModel):
3190
3242
  )
3191
3243
  add_watermark: Optional[bool] = Field(
3192
3244
  default=None,
3193
- description="""Whether to add a watermark to the generated image.
3245
+ description="""Whether to add a watermark to the generated images.
3194
3246
  """,
3195
3247
  )
3196
3248
  aspect_ratio: Optional[str] = Field(
3197
3249
  default=None,
3198
- description="""Aspect ratio of the generated image.
3250
+ description="""Aspect ratio of the generated images.
3251
+ """,
3252
+ )
3253
+ enhance_prompt: Optional[bool] = Field(
3254
+ default=None,
3255
+ description="""Whether to use the prompt rewriting logic.
3199
3256
  """,
3200
3257
  )
3201
3258
 
3202
3259
 
3203
- class GenerateImageConfigDict(TypedDict, total=False):
3204
- """Class that represents the config for generating an image."""
3260
+ class GenerateImagesConfigDict(TypedDict, total=False):
3261
+ """The config for generating an images."""
3205
3262
 
3206
- http_options: Optional[dict[str, Any]]
3263
+ http_options: Optional[HttpOptionsDict]
3207
3264
  """Used to override HTTP request options."""
3208
3265
 
3209
3266
  output_gcs_uri: Optional[str]
@@ -3260,19 +3317,25 @@ class GenerateImageConfigDict(TypedDict, total=False):
3260
3317
  """
3261
3318
 
3262
3319
  add_watermark: Optional[bool]
3263
- """Whether to add a watermark to the generated image.
3320
+ """Whether to add a watermark to the generated images.
3264
3321
  """
3265
3322
 
3266
3323
  aspect_ratio: Optional[str]
3267
- """Aspect ratio of the generated image.
3324
+ """Aspect ratio of the generated images.
3268
3325
  """
3269
3326
 
3327
+ enhance_prompt: Optional[bool]
3328
+ """Whether to use the prompt rewriting logic.
3329
+ """
3270
3330
 
3271
- GenerateImageConfigOrDict = Union[GenerateImageConfig, GenerateImageConfigDict]
3272
3331
 
3332
+ GenerateImagesConfigOrDict = Union[
3333
+ GenerateImagesConfig, GenerateImagesConfigDict
3334
+ ]
3273
3335
 
3274
- class _GenerateImageParameters(_common.BaseModel):
3275
- """Class that represents the parameters for generating an image."""
3336
+
3337
+ class _GenerateImagesParameters(_common.BaseModel):
3338
+ """The parameters for generating images."""
3276
3339
 
3277
3340
  model: Optional[str] = Field(
3278
3341
  default=None,
@@ -3281,39 +3344,39 @@ class _GenerateImageParameters(_common.BaseModel):
3281
3344
  )
3282
3345
  prompt: Optional[str] = Field(
3283
3346
  default=None,
3284
- description="""Text prompt that typically describes the image to output.
3347
+ description="""Text prompt that typically describes the images to output.
3285
3348
  """,
3286
3349
  )
3287
- config: Optional[GenerateImageConfig] = Field(
3350
+ config: Optional[GenerateImagesConfig] = Field(
3288
3351
  default=None,
3289
- description="""Configuration for generating an image.
3352
+ description="""Configuration for generating images.
3290
3353
  """,
3291
3354
  )
3292
3355
 
3293
3356
 
3294
- class _GenerateImageParametersDict(TypedDict, total=False):
3295
- """Class that represents the parameters for generating an image."""
3357
+ class _GenerateImagesParametersDict(TypedDict, total=False):
3358
+ """The parameters for generating images."""
3296
3359
 
3297
3360
  model: Optional[str]
3298
3361
  """ID of the model to use. For a list of models, see `Google models
3299
3362
  <https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_."""
3300
3363
 
3301
3364
  prompt: Optional[str]
3302
- """Text prompt that typically describes the image to output.
3365
+ """Text prompt that typically describes the images to output.
3303
3366
  """
3304
3367
 
3305
- config: Optional[GenerateImageConfigDict]
3306
- """Configuration for generating an image.
3368
+ config: Optional[GenerateImagesConfigDict]
3369
+ """Configuration for generating images.
3307
3370
  """
3308
3371
 
3309
3372
 
3310
- _GenerateImageParametersOrDict = Union[
3311
- _GenerateImageParameters, _GenerateImageParametersDict
3373
+ _GenerateImagesParametersOrDict = Union[
3374
+ _GenerateImagesParameters, _GenerateImagesParametersDict
3312
3375
  ]
3313
3376
 
3314
3377
 
3315
3378
  class Image(_common.BaseModel):
3316
- """Class that represents an image."""
3379
+ """An image."""
3317
3380
 
3318
3381
  gcs_uri: Optional[str] = Field(
3319
3382
  default=None,
@@ -3327,13 +3390,16 @@ class Image(_common.BaseModel):
3327
3390
  or the ``gcs_uri`` field but not both.
3328
3391
  """,
3329
3392
  )
3393
+ mime_type: Optional[str] = Field(
3394
+ default=None, description="""The MIME type of the image."""
3395
+ )
3330
3396
 
3331
3397
  _loaded_image = None
3332
3398
 
3333
3399
  """Image."""
3334
3400
 
3335
- @staticmethod
3336
- def from_file(location: str) -> 'Image':
3401
+ @classmethod
3402
+ def from_file(cls, *, location: str) -> 'Image':
3337
3403
  """Lazy-loads an image from a local file or Google Cloud Storage.
3338
3404
 
3339
3405
  Args:
@@ -3359,11 +3425,11 @@ class Image(_common.BaseModel):
3359
3425
  location = urllib.parse.urlunparse(parsed_url)
3360
3426
 
3361
3427
  if parsed_url.scheme == 'gs':
3362
- return Image(gcs_uri=location)
3428
+ return cls(gcs_uri=location)
3363
3429
 
3364
3430
  # Load image from local path
3365
3431
  image_bytes = pathlib.Path(location).read_bytes()
3366
- image = Image(image_bytes=image_bytes)
3432
+ image = cls(image_bytes=image_bytes)
3367
3433
  return image
3368
3434
 
3369
3435
  def show(self):
@@ -3376,11 +3442,7 @@ class Image(_common.BaseModel):
3376
3442
  except ImportError:
3377
3443
  IPython_display = None
3378
3444
 
3379
- try:
3380
- from PIL import Image as PIL_Image
3381
- except ImportError:
3382
- PIL_Image = None
3383
- if PIL_Image and IPython_display:
3445
+ if IPython_display:
3384
3446
  IPython_display.display(self._pil_image)
3385
3447
 
3386
3448
  @property
@@ -3395,7 +3457,7 @@ class Image(_common.BaseModel):
3395
3457
  if not PIL_Image:
3396
3458
  raise RuntimeError(
3397
3459
  'The PIL module is not available. Please install the Pillow'
3398
- ' package.'
3460
+ ' package. `pip install pillow`'
3399
3461
  )
3400
3462
  self._loaded_image = PIL_Image.open(io.BytesIO(self.image_bytes))
3401
3463
  return self._loaded_image
@@ -3438,7 +3500,7 @@ JOB_STATES_ENDED = JOB_STATES_ENDED_VERTEX + JOB_STATES_ENDED_MLDEV
3438
3500
 
3439
3501
 
3440
3502
  class ImageDict(TypedDict, total=False):
3441
- """Class that represents an image."""
3503
+ """An image."""
3442
3504
 
3443
3505
  gcs_uri: Optional[str]
3444
3506
  """The Cloud Storage URI of the image. ``Image`` can contain a value
@@ -3450,12 +3512,15 @@ class ImageDict(TypedDict, total=False):
3450
3512
  or the ``gcs_uri`` field but not both.
3451
3513
  """
3452
3514
 
3515
+ mime_type: Optional[str]
3516
+ """The MIME type of the image."""
3517
+
3453
3518
 
3454
3519
  ImageOrDict = Union[Image, ImageDict]
3455
3520
 
3456
3521
 
3457
3522
  class GeneratedImage(_common.BaseModel):
3458
- """Class that represents an output image."""
3523
+ """An output image."""
3459
3524
 
3460
3525
  image: Optional[Image] = Field(
3461
3526
  default=None,
@@ -3471,7 +3536,7 @@ class GeneratedImage(_common.BaseModel):
3471
3536
 
3472
3537
 
3473
3538
  class GeneratedImageDict(TypedDict, total=False):
3474
- """Class that represents an output image."""
3539
+ """An output image."""
3475
3540
 
3476
3541
  image: Optional[ImageDict]
3477
3542
  """The output image data.
@@ -3486,8 +3551,8 @@ class GeneratedImageDict(TypedDict, total=False):
3486
3551
  GeneratedImageOrDict = Union[GeneratedImage, GeneratedImageDict]
3487
3552
 
3488
3553
 
3489
- class GenerateImageResponse(_common.BaseModel):
3490
- """Class that represents the output image response."""
3554
+ class GenerateImagesResponse(_common.BaseModel):
3555
+ """The output images response."""
3491
3556
 
3492
3557
  generated_images: Optional[list[GeneratedImage]] = Field(
3493
3558
  default=None,
@@ -3496,16 +3561,16 @@ class GenerateImageResponse(_common.BaseModel):
3496
3561
  )
3497
3562
 
3498
3563
 
3499
- class GenerateImageResponseDict(TypedDict, total=False):
3500
- """Class that represents the output image response."""
3564
+ class GenerateImagesResponseDict(TypedDict, total=False):
3565
+ """The output images response."""
3501
3566
 
3502
3567
  generated_images: Optional[list[GeneratedImageDict]]
3503
3568
  """List of generated images.
3504
3569
  """
3505
3570
 
3506
3571
 
3507
- GenerateImageResponseOrDict = Union[
3508
- GenerateImageResponse, GenerateImageResponseDict
3572
+ GenerateImagesResponseOrDict = Union[
3573
+ GenerateImagesResponse, GenerateImagesResponseDict
3509
3574
  ]
3510
3575
 
3511
3576
 
@@ -3690,7 +3755,7 @@ _ReferenceImageAPIOrDict = Union[_ReferenceImageAPI, _ReferenceImageAPIDict]
3690
3755
  class EditImageConfig(_common.BaseModel):
3691
3756
  """Configuration for editing an image."""
3692
3757
 
3693
- http_options: Optional[dict[str, Any]] = Field(
3758
+ http_options: Optional[HttpOptions] = Field(
3694
3759
  default=None, description="""Used to override HTTP request options."""
3695
3760
  )
3696
3761
  output_gcs_uri: Optional[str] = Field(
@@ -3767,7 +3832,7 @@ class EditImageConfig(_common.BaseModel):
3767
3832
  class EditImageConfigDict(TypedDict, total=False):
3768
3833
  """Configuration for editing an image."""
3769
3834
 
3770
- http_options: Optional[dict[str, Any]]
3835
+ http_options: Optional[HttpOptionsDict]
3771
3836
  """Used to override HTTP request options."""
3772
3837
 
3773
3838
  output_gcs_uri: Optional[str]
@@ -3894,7 +3959,7 @@ class _UpscaleImageAPIConfig(_common.BaseModel):
3894
3959
  to be modifiable or exposed to users in the SDK method.
3895
3960
  """
3896
3961
 
3897
- http_options: Optional[dict[str, Any]] = Field(
3962
+ http_options: Optional[HttpOptions] = Field(
3898
3963
  default=None, description="""Used to override HTTP request options."""
3899
3964
  )
3900
3965
  include_rai_reason: Optional[bool] = Field(
@@ -3922,7 +3987,7 @@ class _UpscaleImageAPIConfigDict(TypedDict, total=False):
3922
3987
  to be modifiable or exposed to users in the SDK method.
3923
3988
  """
3924
3989
 
3925
- http_options: Optional[dict[str, Any]]
3990
+ http_options: Optional[HttpOptionsDict]
3926
3991
  """Used to override HTTP request options."""
3927
3992
 
3928
3993
  include_rai_reason: Optional[bool]
@@ -4005,9 +4070,30 @@ UpscaleImageResponseOrDict = Union[
4005
4070
  ]
4006
4071
 
4007
4072
 
4073
+ class GetModelConfig(_common.BaseModel):
4074
+ """Optional parameters for models.get method."""
4075
+
4076
+ http_options: Optional[HttpOptions] = Field(
4077
+ default=None, description="""Used to override HTTP request options."""
4078
+ )
4079
+
4080
+
4081
+ class GetModelConfigDict(TypedDict, total=False):
4082
+ """Optional parameters for models.get method."""
4083
+
4084
+ http_options: Optional[HttpOptionsDict]
4085
+ """Used to override HTTP request options."""
4086
+
4087
+
4088
+ GetModelConfigOrDict = Union[GetModelConfig, GetModelConfigDict]
4089
+
4090
+
4008
4091
  class _GetModelParameters(_common.BaseModel):
4009
4092
 
4010
4093
  model: Optional[str] = Field(default=None, description="""""")
4094
+ config: Optional[GetModelConfig] = Field(
4095
+ default=None, description="""Optional parameters for the request."""
4096
+ )
4011
4097
 
4012
4098
 
4013
4099
  class _GetModelParametersDict(TypedDict, total=False):
@@ -4015,6 +4101,9 @@ class _GetModelParametersDict(TypedDict, total=False):
4015
4101
  model: Optional[str]
4016
4102
  """"""
4017
4103
 
4104
+ config: Optional[GetModelConfigDict]
4105
+ """Optional parameters for the request."""
4106
+
4018
4107
 
4019
4108
  _GetModelParametersOrDict = Union[_GetModelParameters, _GetModelParametersDict]
4020
4109
 
@@ -4166,7 +4255,7 @@ ModelOrDict = Union[Model, ModelDict]
4166
4255
 
4167
4256
  class ListModelsConfig(_common.BaseModel):
4168
4257
 
4169
- http_options: Optional[dict[str, Any]] = Field(
4258
+ http_options: Optional[HttpOptions] = Field(
4170
4259
  default=None, description="""Used to override HTTP request options."""
4171
4260
  )
4172
4261
  page_size: Optional[int] = Field(default=None, description="""""")
@@ -4180,7 +4269,7 @@ class ListModelsConfig(_common.BaseModel):
4180
4269
 
4181
4270
  class ListModelsConfigDict(TypedDict, total=False):
4182
4271
 
4183
- http_options: Optional[dict[str, Any]]
4272
+ http_options: Optional[HttpOptionsDict]
4184
4273
  """Used to override HTTP request options."""
4185
4274
 
4186
4275
  page_size: Optional[int]
@@ -4235,12 +4324,18 @@ ListModelsResponseOrDict = Union[ListModelsResponse, ListModelsResponseDict]
4235
4324
 
4236
4325
  class UpdateModelConfig(_common.BaseModel):
4237
4326
 
4327
+ http_options: Optional[HttpOptions] = Field(
4328
+ default=None, description="""Used to override HTTP request options."""
4329
+ )
4238
4330
  display_name: Optional[str] = Field(default=None, description="""""")
4239
4331
  description: Optional[str] = Field(default=None, description="""""")
4240
4332
 
4241
4333
 
4242
4334
  class UpdateModelConfigDict(TypedDict, total=False):
4243
4335
 
4336
+ http_options: Optional[HttpOptionsDict]
4337
+ """Used to override HTTP request options."""
4338
+
4244
4339
  display_name: Optional[str]
4245
4340
  """"""
4246
4341
 
@@ -4271,9 +4366,28 @@ _UpdateModelParametersOrDict = Union[
4271
4366
  ]
4272
4367
 
4273
4368
 
4369
+ class DeleteModelConfig(_common.BaseModel):
4370
+
4371
+ http_options: Optional[HttpOptions] = Field(
4372
+ default=None, description="""Used to override HTTP request options."""
4373
+ )
4374
+
4375
+
4376
+ class DeleteModelConfigDict(TypedDict, total=False):
4377
+
4378
+ http_options: Optional[HttpOptionsDict]
4379
+ """Used to override HTTP request options."""
4380
+
4381
+
4382
+ DeleteModelConfigOrDict = Union[DeleteModelConfig, DeleteModelConfigDict]
4383
+
4384
+
4274
4385
  class _DeleteModelParameters(_common.BaseModel):
4275
4386
 
4276
4387
  model: Optional[str] = Field(default=None, description="""""")
4388
+ config: Optional[DeleteModelConfig] = Field(
4389
+ default=None, description="""Optional parameters for the request."""
4390
+ )
4277
4391
 
4278
4392
 
4279
4393
  class _DeleteModelParametersDict(TypedDict, total=False):
@@ -4281,6 +4395,9 @@ class _DeleteModelParametersDict(TypedDict, total=False):
4281
4395
  model: Optional[str]
4282
4396
  """"""
4283
4397
 
4398
+ config: Optional[DeleteModelConfigDict]
4399
+ """Optional parameters for the request."""
4400
+
4284
4401
 
4285
4402
  _DeleteModelParametersOrDict = Union[
4286
4403
  _DeleteModelParameters, _DeleteModelParametersDict
@@ -4412,7 +4529,7 @@ GenerationConfigOrDict = Union[GenerationConfig, GenerationConfigDict]
4412
4529
  class CountTokensConfig(_common.BaseModel):
4413
4530
  """Config for the count_tokens method."""
4414
4531
 
4415
- http_options: Optional[dict[str, Any]] = Field(
4532
+ http_options: Optional[HttpOptions] = Field(
4416
4533
  default=None, description="""Used to override HTTP request options."""
4417
4534
  )
4418
4535
  system_instruction: Optional[ContentUnion] = Field(
@@ -4437,7 +4554,7 @@ class CountTokensConfig(_common.BaseModel):
4437
4554
  class CountTokensConfigDict(TypedDict, total=False):
4438
4555
  """Config for the count_tokens method."""
4439
4556
 
4440
- http_options: Optional[dict[str, Any]]
4557
+ http_options: Optional[HttpOptionsDict]
4441
4558
  """Used to override HTTP request options."""
4442
4559
 
4443
4560
  system_instruction: Optional[ContentUnionDict]
@@ -4521,7 +4638,7 @@ CountTokensResponseOrDict = Union[CountTokensResponse, CountTokensResponseDict]
4521
4638
  class ComputeTokensConfig(_common.BaseModel):
4522
4639
  """Optional parameters for computing tokens."""
4523
4640
 
4524
- http_options: Optional[dict[str, Any]] = Field(
4641
+ http_options: Optional[HttpOptions] = Field(
4525
4642
  default=None, description="""Used to override HTTP request options."""
4526
4643
  )
4527
4644
 
@@ -4529,7 +4646,7 @@ class ComputeTokensConfig(_common.BaseModel):
4529
4646
  class ComputeTokensConfigDict(TypedDict, total=False):
4530
4647
  """Optional parameters for computing tokens."""
4531
4648
 
4532
- http_options: Optional[dict[str, Any]]
4649
+ http_options: Optional[HttpOptionsDict]
4533
4650
  """Used to override HTTP request options."""
4534
4651
 
4535
4652
 
@@ -4629,7 +4746,7 @@ ComputeTokensResponseOrDict = Union[
4629
4746
  class GetTuningJobConfig(_common.BaseModel):
4630
4747
  """Optional parameters for tunings.get method."""
4631
4748
 
4632
- http_options: Optional[dict[str, Any]] = Field(
4749
+ http_options: Optional[HttpOptions] = Field(
4633
4750
  default=None, description="""Used to override HTTP request options."""
4634
4751
  )
4635
4752
 
@@ -4637,7 +4754,7 @@ class GetTuningJobConfig(_common.BaseModel):
4637
4754
  class GetTuningJobConfigDict(TypedDict, total=False):
4638
4755
  """Optional parameters for tunings.get method."""
4639
4756
 
4640
- http_options: Optional[dict[str, Any]]
4757
+ http_options: Optional[HttpOptionsDict]
4641
4758
  """Used to override HTTP request options."""
4642
4759
 
4643
4760
 
@@ -5256,6 +5373,41 @@ class EncryptionSpecDict(TypedDict, total=False):
5256
5373
  EncryptionSpecOrDict = Union[EncryptionSpec, EncryptionSpecDict]
5257
5374
 
5258
5375
 
5376
+ class PartnerModelTuningSpec(_common.BaseModel):
5377
+ """Tuning spec for Partner models."""
5378
+
5379
+ hyper_parameters: Optional[dict[str, Any]] = Field(
5380
+ default=None,
5381
+ description="""Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model.""",
5382
+ )
5383
+ training_dataset_uri: Optional[str] = Field(
5384
+ default=None,
5385
+ description="""Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.""",
5386
+ )
5387
+ validation_dataset_uri: Optional[str] = Field(
5388
+ default=None,
5389
+ description="""Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.""",
5390
+ )
5391
+
5392
+
5393
+ class PartnerModelTuningSpecDict(TypedDict, total=False):
5394
+ """Tuning spec for Partner models."""
5395
+
5396
+ hyper_parameters: Optional[dict[str, Any]]
5397
+ """Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model."""
5398
+
5399
+ training_dataset_uri: Optional[str]
5400
+ """Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file."""
5401
+
5402
+ validation_dataset_uri: Optional[str]
5403
+ """Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file."""
5404
+
5405
+
5406
+ PartnerModelTuningSpecOrDict = Union[
5407
+ PartnerModelTuningSpec, PartnerModelTuningSpecDict
5408
+ ]
5409
+
5410
+
5259
5411
  class DistillationHyperParameters(_common.BaseModel):
5260
5412
  """Hyperparameters for Distillation."""
5261
5413
 
@@ -5351,41 +5503,6 @@ class DistillationSpecDict(TypedDict, total=False):
5351
5503
  DistillationSpecOrDict = Union[DistillationSpec, DistillationSpecDict]
5352
5504
 
5353
5505
 
5354
- class PartnerModelTuningSpec(_common.BaseModel):
5355
- """Tuning spec for Partner models."""
5356
-
5357
- hyper_parameters: Optional[dict[str, Any]] = Field(
5358
- default=None,
5359
- description="""Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model.""",
5360
- )
5361
- training_dataset_uri: Optional[str] = Field(
5362
- default=None,
5363
- description="""Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.""",
5364
- )
5365
- validation_dataset_uri: Optional[str] = Field(
5366
- default=None,
5367
- description="""Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.""",
5368
- )
5369
-
5370
-
5371
- class PartnerModelTuningSpecDict(TypedDict, total=False):
5372
- """Tuning spec for Partner models."""
5373
-
5374
- hyper_parameters: Optional[dict[str, Any]]
5375
- """Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model."""
5376
-
5377
- training_dataset_uri: Optional[str]
5378
- """Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file."""
5379
-
5380
- validation_dataset_uri: Optional[str]
5381
- """Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file."""
5382
-
5383
-
5384
- PartnerModelTuningSpecOrDict = Union[
5385
- PartnerModelTuningSpec, PartnerModelTuningSpecDict
5386
- ]
5387
-
5388
-
5389
5506
  class TuningJob(_common.BaseModel):
5390
5507
  """A tuning job."""
5391
5508
 
@@ -5427,7 +5544,7 @@ class TuningJob(_common.BaseModel):
5427
5544
  )
5428
5545
  tuned_model: Optional[TunedModel] = Field(
5429
5546
  default=None,
5430
- description="""Output only. The tuned model resources assiociated with this TuningJob.""",
5547
+ description="""Output only. The tuned model resources associated with this TuningJob.""",
5431
5548
  )
5432
5549
  supervised_tuning_spec: Optional[SupervisedTuningSpec] = Field(
5433
5550
  default=None, description="""Tuning Spec for Supervised Fine Tuning."""
@@ -5440,16 +5557,12 @@ class TuningJob(_common.BaseModel):
5440
5557
  default=None,
5441
5558
  description="""Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.""",
5442
5559
  )
5443
- distillation_spec: Optional[DistillationSpec] = Field(
5444
- default=None, description="""Tuning Spec for Distillation."""
5445
- )
5446
5560
  partner_model_tuning_spec: Optional[PartnerModelTuningSpec] = Field(
5447
5561
  default=None,
5448
5562
  description="""Tuning Spec for open sourced and third party Partner models.""",
5449
5563
  )
5450
- pipeline_job: Optional[str] = Field(
5451
- default=None,
5452
- description="""Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`.""",
5564
+ distillation_spec: Optional[DistillationSpec] = Field(
5565
+ default=None, description="""Tuning Spec for Distillation."""
5453
5566
  )
5454
5567
  experiment: Optional[str] = Field(
5455
5568
  default=None,
@@ -5459,6 +5572,10 @@ class TuningJob(_common.BaseModel):
5459
5572
  default=None,
5460
5573
  description="""Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""",
5461
5574
  )
5575
+ pipeline_job: Optional[str] = Field(
5576
+ default=None,
5577
+ description="""Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`.""",
5578
+ )
5462
5579
  tuned_model_display_name: Optional[str] = Field(
5463
5580
  default=None,
5464
5581
  description="""Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.""",
@@ -5506,7 +5623,7 @@ class TuningJobDict(TypedDict, total=False):
5506
5623
  """The base model that is being tuned, e.g., "gemini-1.0-pro-002". ."""
5507
5624
 
5508
5625
  tuned_model: Optional[TunedModelDict]
5509
- """Output only. The tuned model resources assiociated with this TuningJob."""
5626
+ """Output only. The tuned model resources associated with this TuningJob."""
5510
5627
 
5511
5628
  supervised_tuning_spec: Optional[SupervisedTuningSpecDict]
5512
5629
  """Tuning Spec for Supervised Fine Tuning."""
@@ -5517,14 +5634,11 @@ class TuningJobDict(TypedDict, total=False):
5517
5634
  encryption_spec: Optional[EncryptionSpecDict]
5518
5635
  """Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key."""
5519
5636
 
5520
- distillation_spec: Optional[DistillationSpecDict]
5521
- """Tuning Spec for Distillation."""
5522
-
5523
5637
  partner_model_tuning_spec: Optional[PartnerModelTuningSpecDict]
5524
5638
  """Tuning Spec for open sourced and third party Partner models."""
5525
5639
 
5526
- pipeline_job: Optional[str]
5527
- """Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`."""
5640
+ distillation_spec: Optional[DistillationSpecDict]
5641
+ """Tuning Spec for Distillation."""
5528
5642
 
5529
5643
  experiment: Optional[str]
5530
5644
  """Output only. The Experiment associated with this TuningJob."""
@@ -5532,6 +5646,9 @@ class TuningJobDict(TypedDict, total=False):
5532
5646
  labels: Optional[dict[str, str]]
5533
5647
  """Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels."""
5534
5648
 
5649
+ pipeline_job: Optional[str]
5650
+ """Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`."""
5651
+
5535
5652
  tuned_model_display_name: Optional[str]
5536
5653
  """Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters."""
5537
5654
 
@@ -5542,6 +5659,9 @@ TuningJobOrDict = Union[TuningJob, TuningJobDict]
5542
5659
  class ListTuningJobsConfig(_common.BaseModel):
5543
5660
  """Configuration for the list tuning jobs method."""
5544
5661
 
5662
+ http_options: Optional[HttpOptions] = Field(
5663
+ default=None, description="""Used to override HTTP request options."""
5664
+ )
5545
5665
  page_size: Optional[int] = Field(default=None, description="""""")
5546
5666
  page_token: Optional[str] = Field(default=None, description="""""")
5547
5667
  filter: Optional[str] = Field(default=None, description="""""")
@@ -5550,6 +5670,9 @@ class ListTuningJobsConfig(_common.BaseModel):
5550
5670
  class ListTuningJobsConfigDict(TypedDict, total=False):
5551
5671
  """Configuration for the list tuning jobs method."""
5552
5672
 
5673
+ http_options: Optional[HttpOptionsDict]
5674
+ """Used to override HTTP request options."""
5675
+
5553
5676
  page_size: Optional[int]
5554
5677
  """"""
5555
5678
 
@@ -5635,7 +5758,7 @@ TuningExampleOrDict = Union[TuningExample, TuningExampleDict]
5635
5758
 
5636
5759
 
5637
5760
  class TuningDataset(_common.BaseModel):
5638
- """Supervised fune-tuning training dataset."""
5761
+ """Supervised fine-tuning training dataset."""
5639
5762
 
5640
5763
  gcs_uri: Optional[str] = Field(
5641
5764
  default=None,
@@ -5648,7 +5771,7 @@ class TuningDataset(_common.BaseModel):
5648
5771
 
5649
5772
 
5650
5773
  class TuningDatasetDict(TypedDict, total=False):
5651
- """Supervised fune-tuning training dataset."""
5774
+ """Supervised fine-tuning training dataset."""
5652
5775
 
5653
5776
  gcs_uri: Optional[str]
5654
5777
  """GCS URI of the file containing training dataset in JSONL format."""
@@ -5682,7 +5805,7 @@ TuningValidationDatasetOrDict = Union[
5682
5805
  class CreateTuningJobConfig(_common.BaseModel):
5683
5806
  """Supervised fine-tuning job creation request - optional fields."""
5684
5807
 
5685
- http_options: Optional[dict[str, Any]] = Field(
5808
+ http_options: Optional[HttpOptions] = Field(
5686
5809
  default=None, description="""Used to override HTTP request options."""
5687
5810
  )
5688
5811
  validation_dataset: Optional[TuningValidationDataset] = Field(
@@ -5720,7 +5843,7 @@ class CreateTuningJobConfig(_common.BaseModel):
5720
5843
  class CreateTuningJobConfigDict(TypedDict, total=False):
5721
5844
  """Supervised fine-tuning job creation request - optional fields."""
5722
5845
 
5723
- http_options: Optional[dict[str, Any]]
5846
+ http_options: Optional[HttpOptionsDict]
5724
5847
  """Used to override HTTP request options."""
5725
5848
 
5726
5849
  validation_dataset: Optional[TuningValidationDatasetDict]
@@ -5805,152 +5928,10 @@ TuningJobOrOperationOrDict = Union[
5805
5928
  ]
5806
5929
 
5807
5930
 
5808
- class DistillationDataset(_common.BaseModel):
5809
- """Training dataset."""
5810
-
5811
- gcs_uri: Optional[str] = Field(
5812
- default=None,
5813
- description="""GCS URI of the file containing training dataset in JSONL format.""",
5814
- )
5815
-
5816
-
5817
- class DistillationDatasetDict(TypedDict, total=False):
5818
- """Training dataset."""
5819
-
5820
- gcs_uri: Optional[str]
5821
- """GCS URI of the file containing training dataset in JSONL format."""
5822
-
5823
-
5824
- DistillationDatasetOrDict = Union[DistillationDataset, DistillationDatasetDict]
5825
-
5826
-
5827
- class DistillationValidationDataset(_common.BaseModel):
5828
- """Validation dataset."""
5829
-
5830
- gcs_uri: Optional[str] = Field(
5831
- default=None,
5832
- description="""GCS URI of the file containing validation dataset in JSONL format.""",
5833
- )
5834
-
5835
-
5836
- class DistillationValidationDatasetDict(TypedDict, total=False):
5837
- """Validation dataset."""
5838
-
5839
- gcs_uri: Optional[str]
5840
- """GCS URI of the file containing validation dataset in JSONL format."""
5841
-
5842
-
5843
- DistillationValidationDatasetOrDict = Union[
5844
- DistillationValidationDataset, DistillationValidationDatasetDict
5845
- ]
5846
-
5847
-
5848
- class CreateDistillationJobConfig(_common.BaseModel):
5849
- """Distillation job creation request - optional fields."""
5850
-
5851
- http_options: Optional[dict[str, Any]] = Field(
5852
- default=None, description="""Used to override HTTP request options."""
5853
- )
5854
- validation_dataset: Optional[DistillationValidationDataset] = Field(
5855
- default=None,
5856
- description="""Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.""",
5857
- )
5858
- tuned_model_display_name: Optional[str] = Field(
5859
- default=None,
5860
- description="""The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters.""",
5861
- )
5862
- epoch_count: Optional[int] = Field(
5863
- default=None,
5864
- description="""Number of complete passes the model makes over the entire training dataset during training.""",
5865
- )
5866
- learning_rate_multiplier: Optional[float] = Field(
5867
- default=None,
5868
- description="""Multiplier for adjusting the default learning rate.""",
5869
- )
5870
- adapter_size: Optional[AdapterSize] = Field(
5871
- default=None, description="""Adapter size for tuning."""
5872
- )
5873
- pipeline_root_directory: Optional[str] = Field(
5874
- default=None,
5875
- description="""The resource name of the PipelineJob associated with the TuningJob. Format:`projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`.""",
5876
- )
5877
-
5878
-
5879
- class CreateDistillationJobConfigDict(TypedDict, total=False):
5880
- """Distillation job creation request - optional fields."""
5881
-
5882
- http_options: Optional[dict[str, Any]]
5883
- """Used to override HTTP request options."""
5884
-
5885
- validation_dataset: Optional[DistillationValidationDatasetDict]
5886
- """Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file."""
5887
-
5888
- tuned_model_display_name: Optional[str]
5889
- """The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters."""
5890
-
5891
- epoch_count: Optional[int]
5892
- """Number of complete passes the model makes over the entire training dataset during training."""
5893
-
5894
- learning_rate_multiplier: Optional[float]
5895
- """Multiplier for adjusting the default learning rate."""
5896
-
5897
- adapter_size: Optional[AdapterSize]
5898
- """Adapter size for tuning."""
5899
-
5900
- pipeline_root_directory: Optional[str]
5901
- """The resource name of the PipelineJob associated with the TuningJob. Format:`projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`."""
5902
-
5903
-
5904
- CreateDistillationJobConfigOrDict = Union[
5905
- CreateDistillationJobConfig, CreateDistillationJobConfigDict
5906
- ]
5907
-
5908
-
5909
- class _CreateDistillationJobParameters(_common.BaseModel):
5910
- """Distillation job creation parameters - optional fields."""
5911
-
5912
- student_model: Optional[str] = Field(
5913
- default=None,
5914
- description="""The student model that is being tuned, e.g. ``google/gemma-2b-1.1-it``.""",
5915
- )
5916
- teacher_model: Optional[str] = Field(
5917
- default=None,
5918
- description="""The teacher model that is being distilled from, e.g. ``gemini-1.0-pro-002``.""",
5919
- )
5920
- training_dataset: Optional[DistillationDataset] = Field(
5921
- default=None,
5922
- description="""Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.""",
5923
- )
5924
- config: Optional[CreateDistillationJobConfig] = Field(
5925
- default=None, description="""Configuration for the distillation job."""
5926
- )
5927
-
5928
-
5929
- class _CreateDistillationJobParametersDict(TypedDict, total=False):
5930
- """Distillation job creation parameters - optional fields."""
5931
-
5932
- student_model: Optional[str]
5933
- """The student model that is being tuned, e.g. ``google/gemma-2b-1.1-it``."""
5934
-
5935
- teacher_model: Optional[str]
5936
- """The teacher model that is being distilled from, e.g. ``gemini-1.0-pro-002``."""
5937
-
5938
- training_dataset: Optional[DistillationDatasetDict]
5939
- """Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file."""
5940
-
5941
- config: Optional[CreateDistillationJobConfigDict]
5942
- """Configuration for the distillation job."""
5943
-
5944
-
5945
- _CreateDistillationJobParametersOrDict = Union[
5946
- _CreateDistillationJobParameters, _CreateDistillationJobParametersDict
5947
- ]
5948
-
5949
-
5950
5931
  class CreateCachedContentConfig(_common.BaseModel):
5951
- """Class for configuring optional cached content creation parameters."""
5932
+ """Optional configuration for cached content creation."""
5952
5933
 
5953
- http_options: Optional[dict[str, Any]] = Field(
5934
+ http_options: Optional[HttpOptions] = Field(
5954
5935
  default=None, description="""Used to override HTTP request options."""
5955
5936
  )
5956
5937
  ttl: Optional[str] = Field(
@@ -5989,9 +5970,9 @@ class CreateCachedContentConfig(_common.BaseModel):
5989
5970
 
5990
5971
 
5991
5972
  class CreateCachedContentConfigDict(TypedDict, total=False):
5992
- """Class for configuring optional cached content creation parameters."""
5973
+ """Optional configuration for cached content creation."""
5993
5974
 
5994
- http_options: Optional[dict[str, Any]]
5975
+ http_options: Optional[HttpOptionsDict]
5995
5976
  """Used to override HTTP request options."""
5996
5977
 
5997
5978
  ttl: Optional[str]
@@ -6117,7 +6098,7 @@ class CachedContent(_common.BaseModel):
6117
6098
  description="""The name of the publisher model to use for cached content.""",
6118
6099
  )
6119
6100
  create_time: Optional[datetime.datetime] = Field(
6120
- default=None, description="""Creatation time of the cache entry."""
6101
+ default=None, description="""Creation time of the cache entry."""
6121
6102
  )
6122
6103
  update_time: Optional[datetime.datetime] = Field(
6123
6104
  default=None,
@@ -6145,7 +6126,7 @@ class CachedContentDict(TypedDict, total=False):
6145
6126
  """The name of the publisher model to use for cached content."""
6146
6127
 
6147
6128
  create_time: Optional[datetime.datetime]
6148
- """Creatation time of the cache entry."""
6129
+ """Creation time of the cache entry."""
6149
6130
 
6150
6131
  update_time: Optional[datetime.datetime]
6151
6132
  """When the cache entry was last updated in UTC time."""
@@ -6163,7 +6144,7 @@ CachedContentOrDict = Union[CachedContent, CachedContentDict]
6163
6144
  class GetCachedContentConfig(_common.BaseModel):
6164
6145
  """Optional parameters for caches.get method."""
6165
6146
 
6166
- http_options: Optional[dict[str, Any]] = Field(
6147
+ http_options: Optional[HttpOptions] = Field(
6167
6148
  default=None, description="""Used to override HTTP request options."""
6168
6149
  )
6169
6150
 
@@ -6171,7 +6152,7 @@ class GetCachedContentConfig(_common.BaseModel):
6171
6152
  class GetCachedContentConfigDict(TypedDict, total=False):
6172
6153
  """Optional parameters for caches.get method."""
6173
6154
 
6174
- http_options: Optional[dict[str, Any]]
6155
+ http_options: Optional[HttpOptionsDict]
6175
6156
  """Used to override HTTP request options."""
6176
6157
 
6177
6158
 
@@ -6215,7 +6196,7 @@ _GetCachedContentParametersOrDict = Union[
6215
6196
  class DeleteCachedContentConfig(_common.BaseModel):
6216
6197
  """Optional parameters for caches.delete method."""
6217
6198
 
6218
- http_options: Optional[dict[str, Any]] = Field(
6199
+ http_options: Optional[HttpOptions] = Field(
6219
6200
  default=None, description="""Used to override HTTP request options."""
6220
6201
  )
6221
6202
 
@@ -6223,7 +6204,7 @@ class DeleteCachedContentConfig(_common.BaseModel):
6223
6204
  class DeleteCachedContentConfigDict(TypedDict, total=False):
6224
6205
  """Optional parameters for caches.delete method."""
6225
6206
 
6226
- http_options: Optional[dict[str, Any]]
6207
+ http_options: Optional[HttpOptionsDict]
6227
6208
  """Used to override HTTP request options."""
6228
6209
 
6229
6210
 
@@ -6284,7 +6265,7 @@ DeleteCachedContentResponseOrDict = Union[
6284
6265
  class UpdateCachedContentConfig(_common.BaseModel):
6285
6266
  """Optional parameters for caches.update method."""
6286
6267
 
6287
- http_options: Optional[dict[str, Any]] = Field(
6268
+ http_options: Optional[HttpOptions] = Field(
6288
6269
  default=None, description="""Used to override HTTP request options."""
6289
6270
  )
6290
6271
  ttl: Optional[str] = Field(
@@ -6300,7 +6281,7 @@ class UpdateCachedContentConfig(_common.BaseModel):
6300
6281
  class UpdateCachedContentConfigDict(TypedDict, total=False):
6301
6282
  """Optional parameters for caches.update method."""
6302
6283
 
6303
- http_options: Optional[dict[str, Any]]
6284
+ http_options: Optional[HttpOptionsDict]
6304
6285
  """Used to override HTTP request options."""
6305
6286
 
6306
6287
  ttl: Optional[str]
@@ -6348,6 +6329,9 @@ _UpdateCachedContentParametersOrDict = Union[
6348
6329
  class ListCachedContentsConfig(_common.BaseModel):
6349
6330
  """Config for caches.list method."""
6350
6331
 
6332
+ http_options: Optional[HttpOptions] = Field(
6333
+ default=None, description="""Used to override HTTP request options."""
6334
+ )
6351
6335
  page_size: Optional[int] = Field(default=None, description="""""")
6352
6336
  page_token: Optional[str] = Field(default=None, description="""""")
6353
6337
 
@@ -6355,6 +6339,9 @@ class ListCachedContentsConfig(_common.BaseModel):
6355
6339
  class ListCachedContentsConfigDict(TypedDict, total=False):
6356
6340
  """Config for caches.list method."""
6357
6341
 
6342
+ http_options: Optional[HttpOptionsDict]
6343
+ """Used to override HTTP request options."""
6344
+
6358
6345
  page_size: Optional[int]
6359
6346
  """"""
6360
6347
 
@@ -6418,7 +6405,7 @@ ListCachedContentsResponseOrDict = Union[
6418
6405
  class ListFilesConfig(_common.BaseModel):
6419
6406
  """Used to override the default configuration."""
6420
6407
 
6421
- http_options: Optional[dict[str, Any]] = Field(
6408
+ http_options: Optional[HttpOptions] = Field(
6422
6409
  default=None, description="""Used to override HTTP request options."""
6423
6410
  )
6424
6411
  page_size: Optional[int] = Field(default=None, description="""""")
@@ -6428,7 +6415,7 @@ class ListFilesConfig(_common.BaseModel):
6428
6415
  class ListFilesConfigDict(TypedDict, total=False):
6429
6416
  """Used to override the default configuration."""
6430
6417
 
6431
- http_options: Optional[dict[str, Any]]
6418
+ http_options: Optional[HttpOptionsDict]
6432
6419
  """Used to override HTTP request options."""
6433
6420
 
6434
6421
  page_size: Optional[int]
@@ -6489,7 +6476,7 @@ ListFilesResponseOrDict = Union[ListFilesResponse, ListFilesResponseDict]
6489
6476
  class CreateFileConfig(_common.BaseModel):
6490
6477
  """Used to override the default configuration."""
6491
6478
 
6492
- http_options: Optional[dict[str, Any]] = Field(
6479
+ http_options: Optional[HttpOptions] = Field(
6493
6480
  default=None, description="""Used to override HTTP request options."""
6494
6481
  )
6495
6482
 
@@ -6497,7 +6484,7 @@ class CreateFileConfig(_common.BaseModel):
6497
6484
  class CreateFileConfigDict(TypedDict, total=False):
6498
6485
  """Used to override the default configuration."""
6499
6486
 
6500
- http_options: Optional[dict[str, Any]]
6487
+ http_options: Optional[HttpOptionsDict]
6501
6488
  """Used to override HTTP request options."""
6502
6489
 
6503
6490
 
@@ -6560,7 +6547,7 @@ CreateFileResponseOrDict = Union[CreateFileResponse, CreateFileResponseDict]
6560
6547
  class GetFileConfig(_common.BaseModel):
6561
6548
  """Used to override the default configuration."""
6562
6549
 
6563
- http_options: Optional[dict[str, Any]] = Field(
6550
+ http_options: Optional[HttpOptions] = Field(
6564
6551
  default=None, description="""Used to override HTTP request options."""
6565
6552
  )
6566
6553
 
@@ -6568,7 +6555,7 @@ class GetFileConfig(_common.BaseModel):
6568
6555
  class GetFileConfigDict(TypedDict, total=False):
6569
6556
  """Used to override the default configuration."""
6570
6557
 
6571
- http_options: Optional[dict[str, Any]]
6558
+ http_options: Optional[HttpOptionsDict]
6572
6559
  """Used to override HTTP request options."""
6573
6560
 
6574
6561
 
@@ -6604,7 +6591,7 @@ _GetFileParametersOrDict = Union[_GetFileParameters, _GetFileParametersDict]
6604
6591
  class DeleteFileConfig(_common.BaseModel):
6605
6592
  """Used to override the default configuration."""
6606
6593
 
6607
- http_options: Optional[dict[str, Any]] = Field(
6594
+ http_options: Optional[HttpOptions] = Field(
6608
6595
  default=None, description="""Used to override HTTP request options."""
6609
6596
  )
6610
6597
 
@@ -6612,7 +6599,7 @@ class DeleteFileConfig(_common.BaseModel):
6612
6599
  class DeleteFileConfigDict(TypedDict, total=False):
6613
6600
  """Used to override the default configuration."""
6614
6601
 
6615
- http_options: Optional[dict[str, Any]]
6602
+ http_options: Optional[HttpOptionsDict]
6616
6603
  """Used to override HTTP request options."""
6617
6604
 
6618
6605
 
@@ -6663,7 +6650,7 @@ DeleteFileResponseOrDict = Union[DeleteFileResponse, DeleteFileResponseDict]
6663
6650
 
6664
6651
 
6665
6652
  class BatchJobSource(_common.BaseModel):
6666
- """Config class for `src` parameter."""
6653
+ """Config for `src` parameter."""
6667
6654
 
6668
6655
  format: Optional[str] = Field(
6669
6656
  default=None,
@@ -6684,7 +6671,7 @@ class BatchJobSource(_common.BaseModel):
6684
6671
 
6685
6672
 
6686
6673
  class BatchJobSourceDict(TypedDict, total=False):
6687
- """Config class for `src` parameter."""
6674
+ """Config for `src` parameter."""
6688
6675
 
6689
6676
  format: Optional[str]
6690
6677
  """Storage format of the input files. Must be one of:
@@ -6704,7 +6691,7 @@ BatchJobSourceOrDict = Union[BatchJobSource, BatchJobSourceDict]
6704
6691
 
6705
6692
 
6706
6693
  class BatchJobDestination(_common.BaseModel):
6707
- """Config class for `des` parameter."""
6694
+ """Config for `des` parameter."""
6708
6695
 
6709
6696
  format: Optional[str] = Field(
6710
6697
  default=None,
@@ -6725,7 +6712,7 @@ class BatchJobDestination(_common.BaseModel):
6725
6712
 
6726
6713
 
6727
6714
  class BatchJobDestinationDict(TypedDict, total=False):
6728
- """Config class for `des` parameter."""
6715
+ """Config for `des` parameter."""
6729
6716
 
6730
6717
  format: Optional[str]
6731
6718
  """Storage format of the output files. Must be one of:
@@ -6745,9 +6732,9 @@ BatchJobDestinationOrDict = Union[BatchJobDestination, BatchJobDestinationDict]
6745
6732
 
6746
6733
 
6747
6734
  class CreateBatchJobConfig(_common.BaseModel):
6748
- """Config class for optional parameters."""
6735
+ """Config for optional parameters."""
6749
6736
 
6750
- http_options: Optional[dict[str, Any]] = Field(
6737
+ http_options: Optional[HttpOptions] = Field(
6751
6738
  default=None, description="""Used to override HTTP request options."""
6752
6739
  )
6753
6740
  display_name: Optional[str] = Field(
@@ -6764,9 +6751,9 @@ class CreateBatchJobConfig(_common.BaseModel):
6764
6751
 
6765
6752
 
6766
6753
  class CreateBatchJobConfigDict(TypedDict, total=False):
6767
- """Config class for optional parameters."""
6754
+ """Config for optional parameters."""
6768
6755
 
6769
- http_options: Optional[dict[str, Any]]
6756
+ http_options: Optional[HttpOptionsDict]
6770
6757
  """Used to override HTTP request options."""
6771
6758
 
6772
6759
  display_name: Optional[str]
@@ -6785,7 +6772,7 @@ CreateBatchJobConfigOrDict = Union[
6785
6772
 
6786
6773
 
6787
6774
  class _CreateBatchJobParameters(_common.BaseModel):
6788
- """Config class for batches.create parameters."""
6775
+ """Config for batches.create parameters."""
6789
6776
 
6790
6777
  model: Optional[str] = Field(
6791
6778
  default=None,
@@ -6806,7 +6793,7 @@ class _CreateBatchJobParameters(_common.BaseModel):
6806
6793
 
6807
6794
 
6808
6795
  class _CreateBatchJobParametersDict(TypedDict, total=False):
6809
- """Config class for batches.create parameters."""
6796
+ """Config for batches.create parameters."""
6810
6797
 
6811
6798
  model: Optional[str]
6812
6799
  """The name of the model to produces the predictions via the BatchJob.
@@ -6828,7 +6815,7 @@ _CreateBatchJobParametersOrDict = Union[
6828
6815
 
6829
6816
 
6830
6817
  class JobError(_common.BaseModel):
6831
- """Config class for the job error."""
6818
+ """Job error."""
6832
6819
 
6833
6820
  details: Optional[list[str]] = Field(
6834
6821
  default=None,
@@ -6842,7 +6829,7 @@ class JobError(_common.BaseModel):
6842
6829
 
6843
6830
 
6844
6831
  class JobErrorDict(TypedDict, total=False):
6845
- """Config class for the job error."""
6832
+ """Job error."""
6846
6833
 
6847
6834
  details: Optional[list[str]]
6848
6835
  """A list of messages that carry the error details. There is a common set of message types for APIs to use."""
@@ -6858,7 +6845,7 @@ JobErrorOrDict = Union[JobError, JobErrorDict]
6858
6845
 
6859
6846
 
6860
6847
  class BatchJob(_common.BaseModel):
6861
- """Config class for batches.create return value."""
6848
+ """Config for batches.create return value."""
6862
6849
 
6863
6850
  name: Optional[str] = Field(
6864
6851
  default=None, description="""Output only. Resource name of the Job."""
@@ -6908,7 +6895,7 @@ class BatchJob(_common.BaseModel):
6908
6895
 
6909
6896
 
6910
6897
  class BatchJobDict(TypedDict, total=False):
6911
- """Config class for batches.create return value."""
6898
+ """Config for batches.create return value."""
6912
6899
 
6913
6900
  name: Optional[str]
6914
6901
  """Output only. Resource name of the Job."""
@@ -6953,7 +6940,7 @@ BatchJobOrDict = Union[BatchJob, BatchJobDict]
6953
6940
  class GetBatchJobConfig(_common.BaseModel):
6954
6941
  """Optional parameters."""
6955
6942
 
6956
- http_options: Optional[dict[str, Any]] = Field(
6943
+ http_options: Optional[HttpOptions] = Field(
6957
6944
  default=None, description="""Used to override HTTP request options."""
6958
6945
  )
6959
6946
 
@@ -6961,7 +6948,7 @@ class GetBatchJobConfig(_common.BaseModel):
6961
6948
  class GetBatchJobConfigDict(TypedDict, total=False):
6962
6949
  """Optional parameters."""
6963
6950
 
6964
- http_options: Optional[dict[str, Any]]
6951
+ http_options: Optional[HttpOptionsDict]
6965
6952
  """Used to override HTTP request options."""
6966
6953
 
6967
6954
 
@@ -6969,7 +6956,7 @@ GetBatchJobConfigOrDict = Union[GetBatchJobConfig, GetBatchJobConfigDict]
6969
6956
 
6970
6957
 
6971
6958
  class _GetBatchJobParameters(_common.BaseModel):
6972
- """Config class for batches.get parameters."""
6959
+ """Config for batches.get parameters."""
6973
6960
 
6974
6961
  name: Optional[str] = Field(
6975
6962
  default=None,
@@ -6984,7 +6971,7 @@ class _GetBatchJobParameters(_common.BaseModel):
6984
6971
 
6985
6972
 
6986
6973
  class _GetBatchJobParametersDict(TypedDict, total=False):
6987
- """Config class for batches.get parameters."""
6974
+ """Config for batches.get parameters."""
6988
6975
 
6989
6976
  name: Optional[str]
6990
6977
  """A fully-qualified BatchJob resource name or ID.
@@ -7004,7 +6991,7 @@ _GetBatchJobParametersOrDict = Union[
7004
6991
  class CancelBatchJobConfig(_common.BaseModel):
7005
6992
  """Optional parameters."""
7006
6993
 
7007
- http_options: Optional[dict[str, Any]] = Field(
6994
+ http_options: Optional[HttpOptions] = Field(
7008
6995
  default=None, description="""Used to override HTTP request options."""
7009
6996
  )
7010
6997
 
@@ -7012,7 +6999,7 @@ class CancelBatchJobConfig(_common.BaseModel):
7012
6999
  class CancelBatchJobConfigDict(TypedDict, total=False):
7013
7000
  """Optional parameters."""
7014
7001
 
7015
- http_options: Optional[dict[str, Any]]
7002
+ http_options: Optional[HttpOptionsDict]
7016
7003
  """Used to override HTTP request options."""
7017
7004
 
7018
7005
 
@@ -7022,7 +7009,7 @@ CancelBatchJobConfigOrDict = Union[
7022
7009
 
7023
7010
 
7024
7011
  class _CancelBatchJobParameters(_common.BaseModel):
7025
- """Config class for batches.cancel parameters."""
7012
+ """Config for batches.cancel parameters."""
7026
7013
 
7027
7014
  name: Optional[str] = Field(
7028
7015
  default=None,
@@ -7037,7 +7024,7 @@ class _CancelBatchJobParameters(_common.BaseModel):
7037
7024
 
7038
7025
 
7039
7026
  class _CancelBatchJobParametersDict(TypedDict, total=False):
7040
- """Config class for batches.cancel parameters."""
7027
+ """Config for batches.cancel parameters."""
7041
7028
 
7042
7029
  name: Optional[str]
7043
7030
  """A fully-qualified BatchJob resource name or ID.
@@ -7054,10 +7041,10 @@ _CancelBatchJobParametersOrDict = Union[
7054
7041
  ]
7055
7042
 
7056
7043
 
7057
- class ListBatchJobConfig(_common.BaseModel):
7058
- """Config class for optional parameters."""
7044
+ class ListBatchJobsConfig(_common.BaseModel):
7045
+ """Config for optional parameters."""
7059
7046
 
7060
- http_options: Optional[dict[str, Any]] = Field(
7047
+ http_options: Optional[HttpOptions] = Field(
7061
7048
  default=None, description="""Used to override HTTP request options."""
7062
7049
  )
7063
7050
  page_size: Optional[int] = Field(default=None, description="""""")
@@ -7065,10 +7052,10 @@ class ListBatchJobConfig(_common.BaseModel):
7065
7052
  filter: Optional[str] = Field(default=None, description="""""")
7066
7053
 
7067
7054
 
7068
- class ListBatchJobConfigDict(TypedDict, total=False):
7069
- """Config class for optional parameters."""
7055
+ class ListBatchJobsConfigDict(TypedDict, total=False):
7056
+ """Config for optional parameters."""
7070
7057
 
7071
- http_options: Optional[dict[str, Any]]
7058
+ http_options: Optional[HttpOptionsDict]
7072
7059
  """Used to override HTTP request options."""
7073
7060
 
7074
7061
  page_size: Optional[int]
@@ -7081,36 +7068,38 @@ class ListBatchJobConfigDict(TypedDict, total=False):
7081
7068
  """"""
7082
7069
 
7083
7070
 
7084
- ListBatchJobConfigOrDict = Union[ListBatchJobConfig, ListBatchJobConfigDict]
7071
+ ListBatchJobsConfigOrDict = Union[ListBatchJobsConfig, ListBatchJobsConfigDict]
7085
7072
 
7086
7073
 
7087
- class _ListBatchJobParameters(_common.BaseModel):
7088
- """Config class for batches.list parameters."""
7074
+ class _ListBatchJobsParameters(_common.BaseModel):
7075
+ """Config for batches.list parameters."""
7089
7076
 
7090
- config: Optional[ListBatchJobConfig] = Field(default=None, description="""""")
7077
+ config: Optional[ListBatchJobsConfig] = Field(
7078
+ default=None, description=""""""
7079
+ )
7091
7080
 
7092
7081
 
7093
- class _ListBatchJobParametersDict(TypedDict, total=False):
7094
- """Config class for batches.list parameters."""
7082
+ class _ListBatchJobsParametersDict(TypedDict, total=False):
7083
+ """Config for batches.list parameters."""
7095
7084
 
7096
- config: Optional[ListBatchJobConfigDict]
7085
+ config: Optional[ListBatchJobsConfigDict]
7097
7086
  """"""
7098
7087
 
7099
7088
 
7100
- _ListBatchJobParametersOrDict = Union[
7101
- _ListBatchJobParameters, _ListBatchJobParametersDict
7089
+ _ListBatchJobsParametersOrDict = Union[
7090
+ _ListBatchJobsParameters, _ListBatchJobsParametersDict
7102
7091
  ]
7103
7092
 
7104
7093
 
7105
- class ListBatchJobResponse(_common.BaseModel):
7106
- """Config class for batches.list return value."""
7094
+ class ListBatchJobsResponse(_common.BaseModel):
7095
+ """Config for batches.list return value."""
7107
7096
 
7108
7097
  next_page_token: Optional[str] = Field(default=None, description="""""")
7109
7098
  batch_jobs: Optional[list[BatchJob]] = Field(default=None, description="""""")
7110
7099
 
7111
7100
 
7112
- class ListBatchJobResponseDict(TypedDict, total=False):
7113
- """Config class for batches.list return value."""
7101
+ class ListBatchJobsResponseDict(TypedDict, total=False):
7102
+ """Config for batches.list return value."""
7114
7103
 
7115
7104
  next_page_token: Optional[str]
7116
7105
  """"""
@@ -7119,13 +7108,33 @@ class ListBatchJobResponseDict(TypedDict, total=False):
7119
7108
  """"""
7120
7109
 
7121
7110
 
7122
- ListBatchJobResponseOrDict = Union[
7123
- ListBatchJobResponse, ListBatchJobResponseDict
7111
+ ListBatchJobsResponseOrDict = Union[
7112
+ ListBatchJobsResponse, ListBatchJobsResponseDict
7113
+ ]
7114
+
7115
+
7116
+ class DeleteBatchJobConfig(_common.BaseModel):
7117
+ """Optional parameters for models.get method."""
7118
+
7119
+ http_options: Optional[HttpOptions] = Field(
7120
+ default=None, description="""Used to override HTTP request options."""
7121
+ )
7122
+
7123
+
7124
+ class DeleteBatchJobConfigDict(TypedDict, total=False):
7125
+ """Optional parameters for models.get method."""
7126
+
7127
+ http_options: Optional[HttpOptionsDict]
7128
+ """Used to override HTTP request options."""
7129
+
7130
+
7131
+ DeleteBatchJobConfigOrDict = Union[
7132
+ DeleteBatchJobConfig, DeleteBatchJobConfigDict
7124
7133
  ]
7125
7134
 
7126
7135
 
7127
7136
  class _DeleteBatchJobParameters(_common.BaseModel):
7128
- """Config class for batches.delete parameters."""
7137
+ """Config for batches.delete parameters."""
7129
7138
 
7130
7139
  name: Optional[str] = Field(
7131
7140
  default=None,
@@ -7134,10 +7143,13 @@ class _DeleteBatchJobParameters(_common.BaseModel):
7134
7143
  or "456" when project and location are initialized in the client.
7135
7144
  """,
7136
7145
  )
7146
+ config: Optional[DeleteBatchJobConfig] = Field(
7147
+ default=None, description="""Optional parameters for the request."""
7148
+ )
7137
7149
 
7138
7150
 
7139
7151
  class _DeleteBatchJobParametersDict(TypedDict, total=False):
7140
- """Config class for batches.delete parameters."""
7152
+ """Config for batches.delete parameters."""
7141
7153
 
7142
7154
  name: Optional[str]
7143
7155
  """A fully-qualified BatchJob resource name or ID.
@@ -7145,6 +7157,9 @@ class _DeleteBatchJobParametersDict(TypedDict, total=False):
7145
7157
  or "456" when project and location are initialized in the client.
7146
7158
  """
7147
7159
 
7160
+ config: Optional[DeleteBatchJobConfigDict]
7161
+ """Optional parameters for the request."""
7162
+
7148
7163
 
7149
7164
  _DeleteBatchJobParametersOrDict = Union[
7150
7165
  _DeleteBatchJobParameters, _DeleteBatchJobParametersDict
@@ -7152,7 +7167,7 @@ _DeleteBatchJobParametersOrDict = Union[
7152
7167
 
7153
7168
 
7154
7169
  class DeleteResourceJob(_common.BaseModel):
7155
- """Config class for the return value of delete operation."""
7170
+ """The return value of delete operation."""
7156
7171
 
7157
7172
  name: Optional[str] = Field(default=None, description="""""")
7158
7173
  done: Optional[bool] = Field(default=None, description="""""")
@@ -7160,7 +7175,7 @@ class DeleteResourceJob(_common.BaseModel):
7160
7175
 
7161
7176
 
7162
7177
  class DeleteResourceJobDict(TypedDict, total=False):
7163
- """Config class for the return value of delete operation."""
7178
+ """The return value of delete operation."""
7164
7179
 
7165
7180
  name: Optional[str]
7166
7181
  """"""
@@ -7369,7 +7384,7 @@ ReplayFileOrDict = Union[ReplayFile, ReplayFileDict]
7369
7384
  class UploadFileConfig(_common.BaseModel):
7370
7385
  """Used to override the default configuration."""
7371
7386
 
7372
- http_options: Optional[dict[str, Any]] = Field(
7387
+ http_options: Optional[HttpOptions] = Field(
7373
7388
  default=None, description="""Used to override HTTP request options."""
7374
7389
  )
7375
7390
  name: Optional[str] = Field(
@@ -7388,7 +7403,7 @@ class UploadFileConfig(_common.BaseModel):
7388
7403
  class UploadFileConfigDict(TypedDict, total=False):
7389
7404
  """Used to override the default configuration."""
7390
7405
 
7391
- http_options: Optional[dict[str, Any]]
7406
+ http_options: Optional[HttpOptionsDict]
7392
7407
  """Used to override HTTP request options."""
7393
7408
 
7394
7409
  name: Optional[str]
@@ -7407,7 +7422,7 @@ UploadFileConfigOrDict = Union[UploadFileConfig, UploadFileConfigDict]
7407
7422
  class DownloadFileConfig(_common.BaseModel):
7408
7423
  """Used to override the default configuration."""
7409
7424
 
7410
- http_options: Optional[dict[str, Any]] = Field(
7425
+ http_options: Optional[HttpOptions] = Field(
7411
7426
  default=None, description="""Used to override HTTP request options."""
7412
7427
  )
7413
7428
 
@@ -7415,7 +7430,7 @@ class DownloadFileConfig(_common.BaseModel):
7415
7430
  class DownloadFileConfigDict(TypedDict, total=False):
7416
7431
  """Used to override the default configuration."""
7417
7432
 
7418
- http_options: Optional[dict[str, Any]]
7433
+ http_options: Optional[HttpOptionsDict]
7419
7434
  """Used to override HTTP request options."""
7420
7435
 
7421
7436
 
@@ -7430,7 +7445,7 @@ class UpscaleImageConfig(_common.BaseModel):
7430
7445
  <https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api>`_.
7431
7446
  """
7432
7447
 
7433
- http_options: Optional[dict[str, Any]] = Field(
7448
+ http_options: Optional[HttpOptions] = Field(
7434
7449
  default=None, description="""Used to override HTTP request options."""
7435
7450
  )
7436
7451
  include_rai_reason: Optional[bool] = Field(
@@ -7457,7 +7472,7 @@ class UpscaleImageConfigDict(TypedDict, total=False):
7457
7472
  <https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api>`_.
7458
7473
  """
7459
7474
 
7460
- http_options: Optional[dict[str, Any]]
7475
+ http_options: Optional[HttpOptionsDict]
7461
7476
  """Used to override HTTP request options."""
7462
7477
 
7463
7478
  include_rai_reason: Optional[bool]
@@ -7515,7 +7530,7 @@ UpscaleImageParametersOrDict = Union[
7515
7530
 
7516
7531
 
7517
7532
  class RawReferenceImage(_common.BaseModel):
7518
- """Class that represents a Raw reference image.
7533
+ """A raw reference image.
7519
7534
 
7520
7535
  A raw reference image represents the base image to edit, provided by the user.
7521
7536
  It can optionally be provided in addition to a mask reference image or
@@ -7546,7 +7561,7 @@ class RawReferenceImage(_common.BaseModel):
7546
7561
 
7547
7562
 
7548
7563
  class RawReferenceImageDict(TypedDict, total=False):
7549
- """Class that represents a Raw reference image.
7564
+ """A raw reference image.
7550
7565
 
7551
7566
  A raw reference image represents the base image to edit, provided by the user.
7552
7567
  It can optionally be provided in addition to a mask reference image or
@@ -7567,7 +7582,7 @@ RawReferenceImageOrDict = Union[RawReferenceImage, RawReferenceImageDict]
7567
7582
 
7568
7583
 
7569
7584
  class MaskReferenceImage(_common.BaseModel):
7570
- """Class that represents a Mask reference image.
7585
+ """A mask reference image.
7571
7586
 
7572
7587
  This encapsulates either a mask image provided by the user and configs for
7573
7588
  the user provided mask, or only config parameters for the model to generate
@@ -7612,7 +7627,7 @@ class MaskReferenceImage(_common.BaseModel):
7612
7627
 
7613
7628
 
7614
7629
  class MaskReferenceImageDict(TypedDict, total=False):
7615
- """Class that represents a Mask reference image.
7630
+ """A mask reference image.
7616
7631
 
7617
7632
  This encapsulates either a mask image provided by the user and configs for
7618
7633
  the user provided mask, or only config parameters for the model to generate
@@ -7640,7 +7655,7 @@ MaskReferenceImageOrDict = Union[MaskReferenceImage, MaskReferenceImageDict]
7640
7655
 
7641
7656
 
7642
7657
  class ControlReferenceImage(_common.BaseModel):
7643
- """Class that represents a Control reference image.
7658
+ """A control reference image.
7644
7659
 
7645
7660
  The image of the control reference image is either a control image provided
7646
7661
  by the user, or a regular image which the backend will use to generate a
@@ -7685,7 +7700,7 @@ class ControlReferenceImage(_common.BaseModel):
7685
7700
 
7686
7701
 
7687
7702
  class ControlReferenceImageDict(TypedDict, total=False):
7688
- """Class that represents a Control reference image.
7703
+ """A control reference image.
7689
7704
 
7690
7705
  The image of the control reference image is either a control image provided
7691
7706
  by the user, or a regular image which the backend will use to generate a
@@ -7715,7 +7730,7 @@ ControlReferenceImageOrDict = Union[
7715
7730
 
7716
7731
 
7717
7732
  class StyleReferenceImage(_common.BaseModel):
7718
- """Class that represents a Style reference image.
7733
+ """A style reference image.
7719
7734
 
7720
7735
  This encapsulates a style reference image provided by the user, and
7721
7736
  additionally optional config parameters for the style reference image.
@@ -7758,7 +7773,7 @@ class StyleReferenceImage(_common.BaseModel):
7758
7773
 
7759
7774
 
7760
7775
  class StyleReferenceImageDict(TypedDict, total=False):
7761
- """Class that represents a Style reference image.
7776
+ """A style reference image.
7762
7777
 
7763
7778
  This encapsulates a style reference image provided by the user, and
7764
7779
  additionally optional config parameters for the style reference image.
@@ -7784,7 +7799,7 @@ StyleReferenceImageOrDict = Union[StyleReferenceImage, StyleReferenceImageDict]
7784
7799
 
7785
7800
 
7786
7801
  class SubjectReferenceImage(_common.BaseModel):
7787
- """Class that represents a Subject reference image.
7802
+ """A subject reference image.
7788
7803
 
7789
7804
  This encapsulates a subject reference image provided by the user, and
7790
7805
  additionally optional config parameters for the subject reference image.
@@ -7827,7 +7842,7 @@ class SubjectReferenceImage(_common.BaseModel):
7827
7842
 
7828
7843
 
7829
7844
  class SubjectReferenceImageDict(TypedDict, total=False):
7830
- """Class that represents a Subject reference image.
7845
+ """A subject reference image.
7831
7846
 
7832
7847
  This encapsulates a subject reference image provided by the user, and
7833
7848
  additionally optional config parameters for the subject reference image.
@@ -7888,7 +7903,7 @@ class LiveServerContent(_common.BaseModel):
7888
7903
  )
7889
7904
  interrupted: Optional[bool] = Field(
7890
7905
  default=None,
7891
- description="""If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in realtime, this is a good signal to stop and empty the current queue. If the client is playing out the content in realtime, this is a good signal to stop and empty the current playback queue.""",
7906
+ description="""If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in realtime, this is a good signal to stop and empty the current queue.""",
7892
7907
  )
7893
7908
 
7894
7909
 
@@ -7906,7 +7921,7 @@ class LiveServerContentDict(TypedDict, total=False):
7906
7921
  """If true, indicates that the model is done generating. Generation will only start in response to additional client messages. Can be set alongside `content`, indicating that the `content` is the last in the turn."""
7907
7922
 
7908
7923
  interrupted: Optional[bool]
7909
- """If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in realtime, this is a good signal to stop and empty the current queue. If the client is playing out the content in realtime, this is a good signal to stop and empty the current playback queue."""
7924
+ """If true, indicates that a client message has interrupted current model generation. If the client is playing out the content in realtime, this is a good signal to stop and empty the current queue."""
7910
7925
 
7911
7926
 
7912
7927
  LiveServerContentOrDict = Union[LiveServerContent, LiveServerContentDict]
@@ -8046,7 +8061,17 @@ class LiveClientSetup(_common.BaseModel):
8046
8061
  )
8047
8062
  generation_config: Optional[GenerationConfig] = Field(
8048
8063
  default=None,
8049
- description="""The generation configuration for the session.""",
8064
+ description="""The generation configuration for the session.
8065
+
8066
+ The following fields are supported:
8067
+ - `response_logprobs`
8068
+ - `response_mime_type`
8069
+ - `logprobs`
8070
+ - `response_schema`
8071
+ - `stop_sequence`
8072
+ - `routing_config`
8073
+ - `audio_timestamp`
8074
+ """,
8050
8075
  )
8051
8076
  system_instruction: Optional[Content] = Field(
8052
8077
  default=None,
@@ -8074,7 +8099,17 @@ class LiveClientSetupDict(TypedDict, total=False):
8074
8099
  """
8075
8100
 
8076
8101
  generation_config: Optional[GenerationConfigDict]
8077
- """The generation configuration for the session."""
8102
+ """The generation configuration for the session.
8103
+
8104
+ The following fields are supported:
8105
+ - `response_logprobs`
8106
+ - `response_mime_type`
8107
+ - `logprobs`
8108
+ - `response_schema`
8109
+ - `stop_sequence`
8110
+ - `routing_config`
8111
+ - `audio_timestamp`
8112
+ """
8078
8113
 
8079
8114
  system_instruction: Optional[ContentDict]
8080
8115
  """The user provided system instructions for the model.
@@ -8106,7 +8141,7 @@ class LiveClientContent(_common.BaseModel):
8106
8141
  description="""The content appended to the current conversation with the model.
8107
8142
 
8108
8143
  For single-turn queries, this is a single instance. For multi-turn
8109
- queries, this is a repeated field that contains conversation history +
8144
+ queries, this is a repeated field that contains conversation history and
8110
8145
  latest request.
8111
8146
  """,
8112
8147
  )
@@ -8131,7 +8166,7 @@ class LiveClientContentDict(TypedDict, total=False):
8131
8166
  """The content appended to the current conversation with the model.
8132
8167
 
8133
8168
  For single-turn queries, this is a single instance. For multi-turn
8134
- queries, this is a repeated field that contains conversation history +
8169
+ queries, this is a repeated field that contains conversation history and
8135
8170
  latest request.
8136
8171
  """
8137
8172
 
@@ -8148,16 +8183,17 @@ class LiveClientRealtimeInput(_common.BaseModel):
8148
8183
  """User input that is sent in real time.
8149
8184
 
8150
8185
  This is different from `ClientContentUpdate` in a few ways:
8151
- - Can be sent continuously without interruption the model generation.
8152
- - If there is a need to mix data interleaved across the
8153
- `ClientContentUpdate` and the `RealtimeUpdate`, server will attempt to
8154
- optimize for best response, but there are no guarantees.
8155
- - End of turn is not explicitly specified, but is rather derived from user
8156
- activity, e.g. end of speech.
8157
- - Even before the end of turn, the data will be processed incrementally
8158
- to optimize for a fast start of the response from the model.
8159
- - Is always assumed to be the user's input (cannot be used to populate
8160
- conversation history).
8186
+
8187
+ - Can be sent continuously without interruption to model generation.
8188
+ - If there is a need to mix data interleaved across the
8189
+ `ClientContentUpdate` and the `RealtimeUpdate`, server attempts to
8190
+ optimize for best response, but there are no guarantees.
8191
+ - End of turn is not explicitly specified, but is rather derived from user
8192
+ activity (for example, end of speech).
8193
+ - Even before the end of turn, the data is processed incrementally
8194
+ to optimize for a fast start of the response from the model.
8195
+ - Is always assumed to be the user's input (cannot be used to populate
8196
+ conversation history).
8161
8197
  """
8162
8198
 
8163
8199
  media_chunks: Optional[list[Blob]] = Field(
@@ -8169,16 +8205,17 @@ class LiveClientRealtimeInputDict(TypedDict, total=False):
8169
8205
  """User input that is sent in real time.
8170
8206
 
8171
8207
  This is different from `ClientContentUpdate` in a few ways:
8172
- - Can be sent continuously without interruption the model generation.
8173
- - If there is a need to mix data interleaved across the
8174
- `ClientContentUpdate` and the `RealtimeUpdate`, server will attempt to
8175
- optimize for best response, but there are no guarantees.
8176
- - End of turn is not explicitly specified, but is rather derived from user
8177
- activity, e.g. end of speech.
8178
- - Even before the end of turn, the data will be processed incrementally
8179
- to optimize for a fast start of the response from the model.
8180
- - Is always assumed to be the user's input (cannot be used to populate
8181
- conversation history).
8208
+
8209
+ - Can be sent continuously without interruption to model generation.
8210
+ - If there is a need to mix data interleaved across the
8211
+ `ClientContentUpdate` and the `RealtimeUpdate`, server attempts to
8212
+ optimize for best response, but there are no guarantees.
8213
+ - End of turn is not explicitly specified, but is rather derived from user
8214
+ activity (for example, end of speech).
8215
+ - Even before the end of turn, the data is processed incrementally
8216
+ to optimize for a fast start of the response from the model.
8217
+ - Is always assumed to be the user's input (cannot be used to populate
8218
+ conversation history).
8182
8219
  """
8183
8220
 
8184
8221
  media_chunks: Optional[list[BlobDict]]
@@ -8268,7 +8305,7 @@ LiveClientMessageOrDict = Union[LiveClientMessage, LiveClientMessageDict]
8268
8305
 
8269
8306
 
8270
8307
  class LiveConnectConfig(_common.BaseModel):
8271
- """Config class for the session."""
8308
+ """Session config for the API connection."""
8272
8309
 
8273
8310
  generation_config: Optional[GenerationConfig] = Field(
8274
8311
  default=None,
@@ -8302,7 +8339,7 @@ class LiveConnectConfig(_common.BaseModel):
8302
8339
 
8303
8340
 
8304
8341
  class LiveConnectConfigDict(TypedDict, total=False):
8305
- """Config class for the session."""
8342
+ """Session config for the API connection."""
8306
8343
 
8307
8344
  generation_config: Optional[GenerationConfigDict]
8308
8345
  """The generation configuration for the session."""