Crackershoot commited on
Commit
3eb6639
·
verified ·
1 Parent(s): f1c8b1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -1,6 +1,6 @@
1
  #pip install 'smolagents[litellm]'
2
- #import subprocess
3
- #subprocess.check_call(['pip', 'install', 'smolagents[litellm]'])
4
 
5
  from smolagents import LiteLLMModel
6
  #from smolagents import CodeAgent, InferenceClientModel
@@ -21,14 +21,14 @@ model = LiteLLMModel(
21
 
22
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
23
  @tool
24
- def get_your_name_age_tool(name:str, age:int)-> str: #it's import to specify the return type
25
  #Keep this format for the description / args / args description but feel free to modify the tool
26
- """A tool that takes the name and age of a person
27
  Args:
28
- name: Name of the person
29
- age: Age of the person
30
  """
31
- return "Your name is {name} and you are {age} old"
32
 
33
  @tool
34
  def get_current_time_in_timezone(timezone: str) -> str:
@@ -67,7 +67,7 @@ with open("prompts.yaml", 'r') as stream:
67
 
68
  agent = CodeAgent(
69
  model=model,
70
- tools=[final_answer, get_your_name_age_tool, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)
71
  max_steps=6,
72
  verbosity_level=1,
73
  grammar=None,
 
1
  #pip install 'smolagents[litellm]'
2
+ import subprocess
3
+ subprocess.check_call(['pip', 'install', 'smolagents[litellm]'])
4
 
5
  from smolagents import LiteLLMModel
6
  #from smolagents import CodeAgent, InferenceClientModel
 
21
 
22
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
23
  @tool
24
+ def get_average_ar(beginning_ar:double, closing_ar:double)-> double: #it's import to specify the return type
25
  #Keep this format for the description / args / args description but feel free to modify the tool
26
+ """A tool that takes that takes the beginning and closing accounts receivable amounts to calculate the average
27
  Args:
28
+ beginning_ar: Last Closed Month Accounts Receivable Amount
29
+ closing_ar: Current Month Accounts Receivable Amount
30
  """
31
+ return (beginning_ar + closing_ar) / 2
32
 
33
  @tool
34
  def get_current_time_in_timezone(timezone: str) -> str:
 
67
 
68
  agent = CodeAgent(
69
  model=model,
70
+ tools=[final_answer, get_average_ar, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)
71
  max_steps=6,
72
  verbosity_level=1,
73
  grammar=None,