Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import traceback
|
| 2 |
+
import streamlit as st
|
| 3 |
+
|
| 4 |
+
st.title("CMBAgent")
|
| 5 |
+
|
| 6 |
+
task = st.text_area("Task", "Draw two random numbers and give me their sum")
|
| 7 |
+
agent = st.selectbox("Agent", ["engineer", "planner", "researcher"], index=0)
|
| 8 |
+
engineer_model = st.text_input("Engineer model", "gpt-4o-mini")
|
| 9 |
+
|
| 10 |
+
if st.button("Run"):
|
| 11 |
+
try:
|
| 12 |
+
import cmbagent
|
| 13 |
+
result = cmbagent.one_shot(
|
| 14 |
+
task,
|
| 15 |
+
agent=agent,
|
| 16 |
+
engineer_model=engineer_model,
|
| 17 |
+
)
|
| 18 |
+
st.write(result)
|
| 19 |
+
except Exception as e:
|
| 20 |
+
st.error(f"Run failed: {e}")
|
| 21 |
+
st.code(traceback.format_exc())
|