Python: Azure AI mapping HostedImageGenerationTool to ImageGenTool#3263
Merged
giles17 merged 6 commits intomicrosoft:mainfrom Jan 23, 2026
Merged
Python: Azure AI mapping HostedImageGenerationTool to ImageGenTool#3263giles17 merged 6 commits intomicrosoft:mainfrom
giles17 merged 6 commits intomicrosoft:mainfrom
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
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
Outdated
Show resolved
Hide resolved
eavanvalkenburg
approved these changes
Jan 19, 2026
dmytrostruk
approved these changes
Jan 21, 2026
python/samples/getting_started/agents/azure_ai/azure_ai_with_image_generation.py
Outdated
Show resolved
Hide resolved
dmytrostruk
approved these changes
Jan 23, 2026
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…icrosoft#3263) * azureai image gen sample fix * mypy fixes * addressed comments + mapping updates * image model fix * content type fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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