jacobolopez commited on
Commit
f5923d6
·
verified ·
1 Parent(s): ae7a494

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -33,6 +33,19 @@ def get_current_time_in_timezone(timezone: str) -> str:
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  final_answer = FinalAnswerTool()
38
 
@@ -55,7 +68,7 @@ with open("prompts.yaml", 'r') as stream:
55
 
56
  agent = CodeAgent(
57
  model=model,
58
- tools=[final_answer], ## add your tools here (don't remove final answer)
59
  max_steps=6,
60
  verbosity_level=1,
61
  grammar=None,
 
33
  except Exception as e:
34
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
35
 
36
+ @tool
37
+ def get_restaurant_suggestion(food_type:str)-> str:
38
+ """A tool that suggests a restaurant based on food type
39
+ Args:
40
+ food_type: the first argument
41
+ """
42
+ if food_type == "asian":
43
+ return "The restaurant suggested should be -The great wall-"
44
+ else if food_type == "italian":
45
+ return "The restaurant suggested should be -It's a me, Mario!-"
46
+ else:
47
+ return "That food type is not present, but we suggest the restaurant -Spanish flavour-"
48
+
49
 
50
  final_answer = FinalAnswerTool()
51
 
 
68
 
69
  agent = CodeAgent(
70
  model=model,
71
+ tools=[final_answer, get_restaurant_suggestion], ## add your tools here (don't remove final answer)
72
  max_steps=6,
73
  verbosity_level=1,
74
  grammar=None,