Skip to content

Feature/runnable example#9

Merged
qchapp merged 9 commits into
developfrom
feature/runnable-example
Nov 10, 2025
Merged

Feature/runnable example#9
qchapp merged 9 commits into
developfrom
feature/runnable-example

Conversation

@qchapp
Copy link
Copy Markdown
Member

@qchapp qchapp commented Nov 10, 2025

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:

  • Improved endpoint selection and normalization in 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]
  • Added support for generating visual previews from tool outputs and storing original result files. (src/ai_agent/agent/tools/gradio_space_tool.py, [1] [2]

Chatbot and UI compatibility updates:

  • Migrated chatbot history to support Gradio's new type="messages" format, adding conversion helpers between legacy pairs and message objects. (src/ai_agent/ui/app.py, [1] [2]
  • Updated all chat history handling in the UI to use the new format, ensuring compatibility and backward support. (src/ai_agent/ui/app.py, [1] [2] [3] [4] [5] [6] [7] [8] [9]

UI polish and demo controls:

  • Demo link textbox and "Run demo on preview" button are now hidden by default and only revealed after tool recommendations appear or a tool is selected; hidden again on Clear. (src/ai_agent/ui/app.py, [1] [2] [3]
  • Improved cache cleaning and fixed preview display for PNG files. (CHANGELOG.md, CHANGELOG.mdR5-R22)

Documentation and changelog:

  • Updated CHANGELOG.md to reflect new features, fixes, and UI polish for version 0.1.3. (CHANGELOG.md, [1] [2]

@qchapp qchapp requested a review from Copilot November 10, 2025 10:48
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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

        def _run_selected_demo(selected_name: str, demo_url: str, uploaded_files):

Comment thread src/ai_agent/agent/tools/gradio_space_tool.py Outdated
Comment thread src/ai_agent/agent/tools/gradio_space_tool.py Outdated
Comment thread CHANGELOG.md
Comment thread CHANGELOG.md
Comment thread src/ai_agent/ui/app.py Outdated
Comment thread CHANGELOG.md
Comment thread src/ai_agent/ui/app.py Outdated
Comment thread src/ai_agent/ui/app.py Outdated
Comment thread src/ai_agent/agent/tools/gradio_space_tool.py
Comment thread src/ai_agent/agent/tools/gradio_space_tool.py
qchapp and others added 7 commits November 10, 2025 12:02
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>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@qchapp qchapp merged commit d816d15 into develop Nov 10, 2025
2 checks passed
@qchapp qchapp deleted the feature/runnable-example branch November 10, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants