rsynak commited on
Commit
bac9ccb
·
verified ·
1 Parent(s): 126d2ae

update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -50,6 +50,16 @@ def get_current_time_in_timezone(timezone: str) -> str:
50
  except Exception as e:
51
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
52
 
 
 
 
 
 
 
 
 
 
 
53
  duckduckgo_tool=DuckDuckGoSearchTool()
54
  final_answer=FinalAnswerTool()
55
 
@@ -72,7 +82,7 @@ with open("prompts.yaml", 'r') as stream:
72
 
73
  agent = CodeAgent(
74
  model=model,
75
- tools=[final_answer, fetch_state_capital_and_altitude, duckduckgo_tool], ## add your tools here (don't remove final answer)
76
  max_steps=6,
77
  verbosity_level=1,
78
  grammar=None,
 
50
  except Exception as e:
51
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
52
 
53
+ @tool
54
+ def my_calculator(intg1: int, intg2: int) -> str:
55
+ """A tool that calculates the product of two integgers
56
+ Args:
57
+ intg1: The first number in the calculation.
58
+ intg2: The second number in the calculation.
59
+ """
60
+ product = intg1 * intg2
61
+ print('{product}')
62
+
63
  duckduckgo_tool=DuckDuckGoSearchTool()
64
  final_answer=FinalAnswerTool()
65
 
 
82
 
83
  agent = CodeAgent(
84
  model=model,
85
+ tools=[final_answer, my_calculator, fetch_state_capital_and_altitude, duckduckgo_tool], ## add your tools here (don't remove final answer)
86
  max_steps=6,
87
  verbosity_level=1,
88
  grammar=None,