-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Enhancement/gpt4o image gen support #4859
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
This PR integrates OpenAI's gpt-image-1 model support into the image generation tool, changing default behaviors and ensuring compatibility across the system.
- Changed default model from 'dall-e-3' to 'gpt-image-1' and enforced base64 output format in
backend/onyx/tools/tool_constructor.py
andconfigs/tool_configs.py
- Updated
litellm
to v1.72.2 with improved rate limiting and 2x higher RPS using aiohttp transport - Added validation in
backend/onyx/tools/tool_implementations/images/image_generation_tool.py
to prevent URL format with gpt-image-1 - Introduced comprehensive test coverage in
backend/tests/integration/tests/tools/test_image_generation_tool.py
- Missing documentation updates for the new model capabilities and configuration options
6 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile
return LLMConfig( | ||
model_provider=llm.config.model_provider, | ||
model_name="dall-e-3", | ||
model_name="gpt-image-1", |
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.
style: Consider adding a constant for 'gpt-image-1' to avoid magic strings, similar to how AZURE_DALLE_DEPLOYMENT_NAME is used
api_key = os.getenv("OPENAI_API_KEY") | ||
if not api_key: | ||
pytest.skip("OPENAI_API_KEY environment variable not set") |
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.
style: test_dalle3_with_base64_format doesn't use the fixture pattern established by other tests, leading to code duplication
* initial model switching changes * Update image generation output format and revise prompt handling * Add validation for output format in ImageGenerationTool and implement tests --------- Co-authored-by: Subash <subash@onyx.app>
* initial model switching changes * Update image generation output format and revise prompt handling * Add validation for output format in ImageGenerationTool and implement tests --------- Co-authored-by: Subash <subash@onyx.app>
This pull request introduces support for the
gpt-image-1
model in the image generation tool and updates related configurations, implementations, and tests.Configuration and Dependency Updates:
b64_json
instead ofurl
intool_configs.py
.litellm
library to version1.72.2
inbackend/requirements/default.txt
.[Provide a brief description of the changes in this PR]
How Has This Been Tested?
Tested by generating image from UI.
[Describe the tests you ran to verify your changes]
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.