Skip to content

add example of gradio in streaming agent with mcp cases #888

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sucran
Copy link

@Sucran Sucran commented Jun 17, 2025

add example of gradio in streaming agent with mcp cases for issue #862

see issue #862

This PR commit an example which shows a best practice about using gradio and agents sdk to build a streaming app with mcp tools.

Edit points

  • event_handler.py : an chain of responsibility implemention to process all stream events defined in agents sdk
  • main.py : an implementation of gradio app and two agents based on deepseek-v3 and gradio mcp tool
  • README.md and demo.png: show how this examples works.
  • pyproject.toml : add gradio into dev dependency list and gradio 5.x version need ruff>=0.9.3 and python >= 3.10.
  • uv.lock: sync change to pyproject.toml

Features

  1. deepseek model integration examples
  2. gradio ChatInterface examples with tool and agent Integrations
  3. chain of responsibility implemention examples to process all stream events defined in agents sdk

@Sucran
Copy link
Author

Sucran commented Jun 17, 2025

@rm-openai hi, Can you please help me review the code? Thank you very much

@Sucran Sucran mentioned this pull request Jun 18, 2025
@Sucran
Copy link
Author

Sucran commented Jun 20, 2025

@rm-openai hi,the conflict is solved. I am thinking, is it better to integrate Gradio in the Extension way mentioned in #855? would love to know your opinion.
Then I have considered using RunHooks and AgentHooks to implement it, but I found that it does not support inference events. Do you think Hooks would be better?

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.

1 participant