Ina-Shapiro commited on
Commit
5747d7c
·
verified ·
1 Parent(s): 50b02c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -9
app.py CHANGED
@@ -1,18 +1,18 @@
1
  import streamlit as st
2
- from smolagents import CodeAgent, DuckDuckGoSearchTool
 
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
- # Create agents
10
  agents = {
11
- "Search Agent": "A search agent that can find information online",
12
- "Chat Agent": "A general purpose chat agent"
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.write(f"You said: {user_input}")
30
- st.write("Agent response: This is a test response!")
 
 
 
 
 
 
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()