Skip to content

Conversation

@h0rv
Copy link
Contributor

@h0rv h0rv commented Dec 17, 2025

As of now, these options are only available via vertex-ai, not google-gla

…t_format` for Vertex AI Gemini image models
@h0rv h0rv force-pushed the robby/add-gemini-output-mime-type-support branch from 51b8ccd to d04282d Compare December 17, 2025 22:52
@h0rv h0rv force-pushed the robby/add-gemini-output-mime-type-support branch from 9ac31a2 to 9df6bcd Compare December 18, 2025 00:27
Supported by:
* OpenAI Responses. Default: 'png'.
* Google (Vertex AI only).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add in the default, which I'm assuming is also PNG?


# Test output_format rejection
agent = Agent(model, builtin_tools=[ImageGenerationTool(output_format='png')], output_type=BinaryImage)
with pytest.raises(ValueError, match='output_mime_type parameter is not supported in Gemini API'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of hitting errors, let's ignore the field silently as we would've done before. We've already documented it only works with Vertex, so we can check self.system == 'google-vertex' inside GoogleModel

Supported by:
* OpenAI Responses. Only supported for 'png' and 'webp' output formats.
* Google (Vertex AI only). Only supported for 'jpeg' output format.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the docs as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants