Skip to content

Commit 41e698d

Browse files
Annhiluccopybara-github
authored andcommitted
format: Update to format code using pyink
PiperOrigin-RevId: 772979977
1 parent c54a549 commit 41e698d

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

google/genai/models.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3451,12 +3451,14 @@ def _GenerateVideosParameters_to_vertex(
34513451

34523452

34533453
def _FeatureSelectionPreference_to_mldev_enum_validate(enum_value: Any) -> None:
3454-
if enum_value in set([
3455-
'FEATURE_SELECTION_PREFERENCE_UNSPECIFIED',
3456-
'PRIORITIZE_QUALITY',
3457-
'BALANCED',
3458-
'PRIORITIZE_COST',
3459-
]):
3454+
if enum_value in set(
3455+
[
3456+
'FEATURE_SELECTION_PREFERENCE_UNSPECIFIED',
3457+
'PRIORITIZE_QUALITY',
3458+
'BALANCED',
3459+
'PRIORITIZE_COST',
3460+
]
3461+
):
34603462
raise ValueError(f'{enum_value} enum value is not supported in Gemini API.')
34613463

34623464

google/genai/types.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,22 +1623,26 @@ def raise_error_if_cannot_convert(
16231623
if field_value is None:
16241624
continue
16251625
if field_name not in google_schema_field_names:
1626-
raise ValueError((
1627-
f'JSONSchema field "{field_name}" is not supported by the '
1628-
'Schema object. And the "raise_error_on_unsupported_field" '
1629-
'argument is set to True. If you still want to convert '
1630-
'it into the Schema object, please either remove the field '
1631-
f'"{field_name}" from the JSONSchema object, or leave the '
1632-
'"raise_error_on_unsupported_field" unset.'
1633-
))
1626+
raise ValueError(
1627+
(
1628+
f'JSONSchema field "{field_name}" is not supported by the '
1629+
'Schema object. And the "raise_error_on_unsupported_field" '
1630+
'argument is set to True. If you still want to convert '
1631+
'it into the Schema object, please either remove the field '
1632+
f'"{field_name}" from the JSONSchema object, or leave the '
1633+
'"raise_error_on_unsupported_field" unset.'
1634+
)
1635+
)
16341636
if (
16351637
field_name in gemini_api_unsupported_field_names
16361638
and api_option == 'GEMINI_API'
16371639
):
1638-
raise ValueError((
1639-
f'The "{field_name}" field is not supported by the Schema '
1640-
'object for GEMINI_API.'
1641-
))
1640+
raise ValueError(
1641+
(
1642+
f'The "{field_name}" field is not supported by the Schema '
1643+
'object for GEMINI_API.'
1644+
)
1645+
)
16421646

16431647
def copy_schema_fields(
16441648
json_schema_dict: dict[str, Any],

0 commit comments

Comments
 (0)