Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from smolagents import CodeAgent,
|
|
|
|
| 3 |
|
| 4 |
st.set_page_config(page_title="AI Agents", page_icon="🤖")
|
| 5 |
|
| 6 |
def main():
|
| 7 |
st.title("🤖 Good evening, Ina Shapiro")
|
| 8 |
|
| 9 |
-
#
|
| 10 |
agents = {
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
}
|
| 14 |
|
| 15 |
-
# Agent selection dropdown
|
| 16 |
selected_agent = st.selectbox(
|
| 17 |
"Please select an Agent",
|
| 18 |
options=list(agents.keys()),
|
|
@@ -21,13 +21,19 @@ def main():
|
|
| 21 |
)
|
| 22 |
|
| 23 |
if selected_agent:
|
| 24 |
-
st.success(f"Selected: {selected_agent}")
|
| 25 |
|
| 26 |
-
# Simple chat interface
|
| 27 |
user_input = st.text_input("Enter your message:")
|
|
|
|
| 28 |
if user_input:
|
| 29 |
-
st.
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
if __name__ == "__main__":
|
| 33 |
main()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from smolagents import CodeAgent, HfApiModel
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
st.set_page_config(page_title="AI Agents", page_icon="🤖")
|
| 6 |
|
| 7 |
def main():
|
| 8 |
st.title("🤖 Good evening, Ina Shapiro")
|
| 9 |
|
| 10 |
+
# Simple working agents without complex tools first
|
| 11 |
agents = {
|
| 12 |
+
"Chat Agent": "A simple chat agent",
|
| 13 |
+
"Helper Agent": "A helpful assistant agent"
|
| 14 |
}
|
| 15 |
|
|
|
|
| 16 |
selected_agent = st.selectbox(
|
| 17 |
"Please select an Agent",
|
| 18 |
options=list(agents.keys()),
|
|
|
|
| 21 |
)
|
| 22 |
|
| 23 |
if selected_agent:
|
| 24 |
+
st.success(f"✅ Selected: {selected_agent}")
|
| 25 |
|
|
|
|
| 26 |
user_input = st.text_input("Enter your message:")
|
| 27 |
+
|
| 28 |
if user_input:
|
| 29 |
+
with st.spinner("Agent is thinking..."):
|
| 30 |
+
try:
|
| 31 |
+
# Simple response for now
|
| 32 |
+
response = f"Hello! I'm the {selected_agent}. You said: '{user_input}'. How can I help you?"
|
| 33 |
+
st.write("**Agent Response:**")
|
| 34 |
+
st.write(response)
|
| 35 |
+
except Exception as e:
|
| 36 |
+
st.error(f"Error: {str(e)}")
|
| 37 |
|
| 38 |
if __name__ == "__main__":
|
| 39 |
main()
|