google-genai 1.25.0__py3-none-any.whl → 1.27.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.
@@ -1010,17 +1010,27 @@ def t_batch_job_source(
1010
1010
  raise ValueError(f'Unsupported source: {src}')
1011
1011
 
1012
1012
 
1013
- def t_batch_job_destination(dest: str) -> types.BatchJobDestination:
1014
- if dest.startswith('gs://'):
1015
- return types.BatchJobDestination(
1016
- format='jsonl',
1017
- gcs_uri=dest,
1018
- )
1019
- elif dest.startswith('bq://'):
1020
- return types.BatchJobDestination(
1021
- format='bigquery',
1022
- bigquery_uri=dest,
1023
- )
1013
+ def t_batch_job_destination(
1014
+ dest: Union[str, types.BatchJobDestinationOrDict],
1015
+ ) -> types.BatchJobDestination:
1016
+ if isinstance(dest, dict):
1017
+ dest = types.BatchJobDestination(**dest)
1018
+ return dest
1019
+ elif isinstance(dest, str):
1020
+ if dest.startswith('gs://'):
1021
+ return types.BatchJobDestination(
1022
+ format='jsonl',
1023
+ gcs_uri=dest,
1024
+ )
1025
+ elif dest.startswith('bq://'):
1026
+ return types.BatchJobDestination(
1027
+ format='bigquery',
1028
+ bigquery_uri=dest,
1029
+ )
1030
+ else:
1031
+ raise ValueError(f'Unsupported destination: {dest}')
1032
+ elif isinstance(dest, types.BatchJobDestination):
1033
+ return dest
1024
1034
  else:
1025
1035
  raise ValueError(f'Unsupported destination: {dest}')
1026
1036