Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
#pip install 'smolagents[litellm]'
|
2 |
-
|
3 |
-
|
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
|
25 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
26 |
-
"""A tool that takes the
|
27 |
Args:
|
28 |
-
|
29 |
-
|
30 |
"""
|
31 |
-
return
|
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,
|
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,
|