-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Updates to Agent image generation tool tests #44267
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
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.
Pull request overview
This PR updates the agent image generation tool tests to enable recording and adds an async version of the test. The changes refactor configuration management by moving the image model deployment name from environment variables to a test parameter dictionary, aligning with the pattern used for other test configurations.
Key Changes:
- Created new async test for image generation (
test_agent_image_generation_async.py) - Updated sync test to use
recorded_by_proxydecorator instead of skipping during recording - Refactored configuration to use
test_agents_tools_paramsdictionary instead of environment variable - Added test recordings (assets.json tag update)
- Both tests now save generated images to
.assetsdirectory (which is properly gitignored)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/ai/azure-ai-projects/tests/test_base.py | Moved image model deployment configuration from servicePreparer to new test_agents_tools_params dictionary for better organization |
| sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py | New async version of image generation test using recorded_by_proxy_async decorator with proper async context managers |
| sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py | Updated to use recorded_by_proxy decorator, changed pytest.skip to pytest.fail for missing deployments, added image saving functionality, and refactored to use new config structure |
| sdk/ai/azure-ai-projects/.env.template | Removed obsolete AZURE_AI_PROJECTS_TESTS_IMAGE_MODEL_DEPLOYMENT_NAME environment variable entry |
| sdk/ai/azure-ai-projects/assets.json | Updated test recording tag to reflect new test recordings |
gpt-image-1), you need to mention the image generation AI model in two places: while definingImageGenTool(when creating the Agent) and when doing the Responses call, in ax-ms-oai-image-generation-deploymentHTTP request header. Need to fix this public doc to do the same. I updated sample code to do this as well as test code. And changes sample code to usegpt-image-1-miniinstead ofgpt-image-1to show an example of a non-default model.