Skip to content

format: Update to format code using pyink #956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions google/genai/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3451,12 +3451,14 @@ def _GenerateVideosParameters_to_vertex(


def _FeatureSelectionPreference_to_mldev_enum_validate(enum_value: Any) -> None:
if enum_value in set([
'FEATURE_SELECTION_PREFERENCE_UNSPECIFIED',
'PRIORITIZE_QUALITY',
'BALANCED',
'PRIORITIZE_COST',
]):
if enum_value in set(
[
'FEATURE_SELECTION_PREFERENCE_UNSPECIFIED',
'PRIORITIZE_QUALITY',
'BALANCED',
'PRIORITIZE_COST',
]
):
raise ValueError(f'{enum_value} enum value is not supported in Gemini API.')


Expand Down
28 changes: 16 additions & 12 deletions google/genai/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,22 +1623,26 @@ def raise_error_if_cannot_convert(
if field_value is None:
continue
if field_name not in google_schema_field_names:
raise ValueError((
f'JSONSchema field "{field_name}" is not supported by the '
'Schema object. And the "raise_error_on_unsupported_field" '
'argument is set to True. If you still want to convert '
'it into the Schema object, please either remove the field '
f'"{field_name}" from the JSONSchema object, or leave the '
'"raise_error_on_unsupported_field" unset.'
))
raise ValueError(
(
f'JSONSchema field "{field_name}" is not supported by the '
'Schema object. And the "raise_error_on_unsupported_field" '
'argument is set to True. If you still want to convert '
'it into the Schema object, please either remove the field '
f'"{field_name}" from the JSONSchema object, or leave the '
'"raise_error_on_unsupported_field" unset.'
)
)
if (
field_name in gemini_api_unsupported_field_names
and api_option == 'GEMINI_API'
):
raise ValueError((
f'The "{field_name}" field is not supported by the Schema '
'object for GEMINI_API.'
))
raise ValueError(
(
f'The "{field_name}" field is not supported by the Schema '
'object for GEMINI_API.'
)
)

def copy_schema_fields(
json_schema_dict: dict[str, Any],
Expand Down