Feature/runnable example#9
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds Gradio demo execution functionality to the imaging tool recommender, along with a chatbot format migration and UI improvements. Key changes include:
- Adding a "Run demo on preview" button that executes recommended tools on user-uploaded images via Gradio client
- Migrating the chatbot from "tuples" format to "messages" format with backward-compatible conversion functions
- Hiding demo controls until a tool is recommended, improving the initial UI cleanliness
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
| src/ai_agent/ui/app.py | Adds demo execution UI controls, chatbot format conversion helpers, and integrates tool_run_example functionality with visibility state management |
| src/ai_agent/agent/tools/gradio_space_tool.py | Refactors remote demo execution to use hardcoded /segment endpoint, adds result materialization and preview generation, plus HuggingFace Space URL normalization |
| CHANGELOG.md | Documents new features and fixes in version 0.1.3 release notes |
Comments suppressed due to low confidence (1)
src/ai_agent/ui/app.py:712
- create_interface._run_selected_demo returns tuple of size 3 and tuple of size 4.
create_interface._run_selected_demo returns tuple of size 3 and tuple of size 4.
create_interface._run_selected_demo returns tuple of size 3 and tuple of size 4.
create_interface._run_selected_demo returns tuple of size 3 and tuple of size 4.
create_interface._run_selected_demo returns tuple of size 3 and tuple of size 4.
create_interface._run_selected_demo returns tuple of size 3 and tuple of size 4.
def _run_selected_demo(selected_name: str, demo_url: str, uploaded_files):
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…imaging-plaza-ai-agent into feature/runnable-example
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
This pull request introduces significant improvements to the Gradio space runner tool and the UI, focusing on better handling of image inputs, more robust demo controls, and compatibility with Gradio's updated chat schema. The changes also polish the user interface by conditionally showing demo controls and improve the chatbot's handling of message formats. Additionally, the Gradio runner now materializes image results for previews and handles endpoint normalization more reliably.
Gradio space runner tool enhancements:
gradio_space_tool.py, with robust handling of Hugging Face Spaces URLs and API tokens, and added logic to materialize image results for previews. (src/ai_agent/agent/tools/gradio_space_tool.py, [1] [2] [3]src/ai_agent/agent/tools/gradio_space_tool.py, [1] [2]Chatbot and UI compatibility updates:
type="messages"format, adding conversion helpers between legacy pairs and message objects. (src/ai_agent/ui/app.py, [1] [2]src/ai_agent/ui/app.py, [1] [2] [3] [4] [5] [6] [7] [8] [9]UI polish and demo controls:
src/ai_agent/ui/app.py, [1] [2] [3]CHANGELOG.md, CHANGELOG.mdR5-R22)Documentation and changelog:
CHANGELOG.mdto reflect new features, fixes, and UI polish for version 0.1.3. (CHANGELOG.md, [1] [2]