Skip to content

feat: add Streamlit team example with stop-and-resume pattern#7601

Open
lawcontinue wants to merge 4 commits intomicrosoft:mainfrom
lawcontinue:feat/streamlit-team-user-proxy
Open

feat: add Streamlit team example with stop-and-resume pattern#7601
lawcontinue wants to merge 4 commits intomicrosoft:mainfrom
lawcontinue:feat/streamlit-team-user-proxy

Conversation

@lawcontinue
Copy link
Copy Markdown

@lawcontinue lawcontinue commented Apr 18, 2026

Addresses #5626

Summary

Adds a Streamlit example demonstrating the stop-and-resume pattern for interactive multi-agent teams.

Why Not UserProxyAgent?

Issue #5626 asks for a Team(AssistantAgent + UserProxyAgent) in Streamlit. The challenge is that UserProxyAgent.input_func blocks the event loop waiting for human input, but Streamlit reruns the entire script on each interaction — making blocking calls unreliable.

The official UserProxyAgent docstring recommends:

"For typical use cases that involve slow human responses, it is recommended to use termination conditions such as HandoffTermination or SourceMatchTermination to stop the running team and return the control to the application. You can run the team again with the user input."

This example follows that guidance: MaxMessageTermination(max_messages=1) stops after the assistant responds, then Streamlit collects user input and resumes the team. The team state persists in st.session_state so the conversation continues naturally.

For frameworks with native async support (ChainLit, FastAPI), see the ChainLit example which uses UserProxyAgent directly.

Files Added

  • python/samples/agentchat_streamlit_team/app.py — Streamlit app with chat UI
  • python/samples/agentchat_streamlit_team/model_config.yaml — Model configuration template
  • python/samples/agentchat_streamlit_team/requirements.txt — Dependencies
  • python/samples/agentchat_streamlit_team/README.md — Usage instructions

Related

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