sirine1712 commited on
Commit
d7da87a
Β·
verified Β·
1 Parent(s): 1232563

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -53,20 +53,23 @@ class WebSearchAgent:
53
  tools=[duck_search, calculator],
54
  model="gpt-3.5-turbo", # You can use gpt-4o if you have access
55
  planning_interval=5,
56
- system_prompt=(
57
- "You're a helpful reasoning agent. Use the provided tools "
58
- "to help answer the user's questions accurately."
59
- ),
60
  )
61
  print("βœ… Agent initialized.")
62
 
63
  def __call__(self, question: str) -> str:
64
- print(f"πŸ” Question: {question}")
65
- try:
66
- return self.agent.run(question)
67
- except Exception as e:
68
- print(f"❌ Agent error: {e}")
69
- return f"Error: {e}"
 
 
 
 
 
 
 
70
 
71
  # --- Constants ---
72
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
 
53
  tools=[duck_search, calculator],
54
  model="gpt-3.5-turbo", # You can use gpt-4o if you have access
55
  planning_interval=5,
 
 
 
 
56
  )
57
  print("βœ… Agent initialized.")
58
 
59
  def __call__(self, question: str) -> str:
60
+ print(f"πŸ” Question: {question}")
61
+ try:
62
+ return self.agent.run(
63
+ question,
64
+ step_limit=5,
65
+ system_prompt=(
66
+ "You're a helpful reasoning agent. Use the tools available to search or compute as needed "
67
+ "to provide accurate and concise answers to the user's question."
68
+ )
69
+ )
70
+ except Exception as e:
71
+ print(f"❌ Agent error: {e}")
72
+ return f"Error: {e}"
73
 
74
  # --- Constants ---
75
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"