-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support image generation and output with Google and OpenAI #2970
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
Conversation
Docs Preview
|
# Conflicts: # pydantic_ai_slim/pydantic_ai/_output.py # pydantic_ai_slim/pydantic_ai/builtin_tools.py # pydantic_ai_slim/pydantic_ai/models/openai.py # tests/models/test_openai_responses.py
| _messages.ModelRequest(parts=output_parts, instructions=instructions) | ||
| ) | ||
|
|
||
| async def _handle_text_response( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was moved up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not worth reviewing, I just moved some logic around to get the allows_image boolean everywhere we need it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🫡
| # This is currently never returned from gemini | ||
| pass | ||
| elif isinstance(item, FilePart): # pragma: no cover | ||
| # Images generated by models are not sent back to models that don't themselves generate images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Images generated by models are not sent back to models that don't themselves generate images. | |
| # Files generated by models are not sent back to models that don't themselves generate files. |
Google
OpenAI
To do
result.outputviaoutput_type=Imageoutput_type=Image | stror other combinationsrevised_promptas built-in tool call result