-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python: Azure AI mapping HostedImageGenerationTool to ImageGenTool #3263
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
base: main
Are you sure you want to change the base?
Conversation
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
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 fixes the Azure AI image generation sample by adding the missing handler for HostedImageGenerationTool in the Azure AI integration layer and updating the sample to use the correct content types for image generation results.
Changes:
- Added
HostedImageGenerationTooltoImageGenToolmapping in Azure AI integration - Updated sample to use
ImageGenerationToolResultContentinstead ofDataContentfor extracting image data - Changed image save location from script directory to OS temporary directory
- Updated model name from
gpt-image-1-minitogpt-image-1in tool options
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
python/samples/getting_started/agents/azure_ai/azure_ai_with_image_generation.py |
Updated sample to use correct content types and save location; however, uses incorrect option keys |
python/packages/azure-ai/agent_framework_azure_ai/_shared.py |
Added handler to map HostedImageGenerationTool to Azure AI's ImageGenTool |
python/samples/getting_started/agents/azure_ai/azure_ai_with_image_generation.py
Outdated
Show resolved
Hide resolved
python/samples/getting_started/agents/azure_ai/azure_ai_with_image_generation.py
Show resolved
Hide resolved
|
|
||
| import aiofiles | ||
| from agent_framework import DataContent, HostedImageGenerationTool | ||
| from agent_framework import HostedImageGenerationTool, ImageGenerationToolResultContent |
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 content type no longer exists
Motivation and Context
This PR fixes the Azure AI image generation sample by adding the missing handler for
HostedImageGenerationToolin the Azure AI integration layer and updating the sample to use the correct content types for image generation results.Changes:
HostedImageGenerationTooltoImageGenToolmapping in Azure AI integrationImageGenerationToolResultContentinstead ofDataContentfor extracting image datagpt-image-1-minitogpt-image-1in tool options (the Image Generation tool is empowered by the gpt-image-1 model.)Description
Contribution Checklist