Streamlit issue AutoGen 0.4 Code Executor #5126
Unanswered
sridharratna
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Your platform and Python version? Looks like a streamlit issue to me. Not familiar with it, but could be that streamlit may be using an asyncio event loop that doesn't work well with |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to run the console based program to run inside streamlit. but getting the error as below.. which works fine when removed streamlit wrapper. Replacing MagenticOneGroupChat with RoundRobinGroupChat also have the same.
What am I missing here? I am new to python
attached the error image
`from pathlib import Path
from autogen_agentchat.agents import AssistantAgent, CodeExecutorAgent
from autogen_agentchat.conditions import MaxMessageTermination, TextMentionTermination
from autogen_agentchat.ui import Console
from autogen_agentchat.teams import MagenticOneGroupChat
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.code_executors.local import LocalCommandLineCodeExecutor
from autogen_ext.models.openai import OpenAIChatCompletionClient
import asyncio
import venv
import streamlit as st
model_client = OpenAIChatCompletionClient(model="llama-3.3-70b-versatile",
base_url="https://api.groq.com/openai/v1",
api_key="xxxxxxxxxxxxxxxxxxxxxxx",
model_info={
"vision": False,
"function_calling": True,
"json_output": True
})
async def main():
st.set_page_config(page_title="CodeAgent", page_icon=":robot:")
st.title("CodeAgent 🤖")
st.write("An AI agent that can read and write code to solve programming problems.")
work_dir = Path("coding")
work_dir.mkdir(exist_ok=True)
if name == "main":
asyncio.run(main())`
Beta Was this translation helpful? Give feedback.
All reactions