Spaces:
Sleeping
Sleeping
Update app.py
Browse filesadd get_joke to list of tools
app.py
CHANGED
|
@@ -62,7 +62,7 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 62 |
# except requests.exceptions.RequestException as e:
|
| 63 |
# return f"Error fetching quote: {str(e)}"
|
| 64 |
|
| 65 |
-
|
| 66 |
@tool
|
| 67 |
def get_joke() -> str:
|
| 68 |
"""
|
|
@@ -129,7 +129,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 129 |
|
| 130 |
agent = CodeAgent(
|
| 131 |
model=model,
|
| 132 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 133 |
max_steps=6,
|
| 134 |
verbosity_level=1,
|
| 135 |
grammar=None,
|
|
|
|
| 62 |
# except requests.exceptions.RequestException as e:
|
| 63 |
# return f"Error fetching quote: {str(e)}"
|
| 64 |
|
| 65 |
+
#https://github.com/huggingface/smolagents/blob/main/examples/multiple_tools.py
|
| 66 |
@tool
|
| 67 |
def get_joke() -> str:
|
| 68 |
"""
|
|
|
|
| 129 |
|
| 130 |
agent = CodeAgent(
|
| 131 |
model=model,
|
| 132 |
+
tools=[final_answer, get_joke,], ## add your tools here (don't remove final answer)
|
| 133 |
max_steps=6,
|
| 134 |
verbosity_level=1,
|
| 135 |
grammar=None,
|