Update app.py
Browse files
app.py
CHANGED
|
@@ -9,15 +9,13 @@ from Gradio_UI import GradioUI
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
-
def
|
| 13 |
#Keep this format for the description / args description but feel free to modify the tool
|
| 14 |
-
"""A tool that
|
| 15 |
Args:
|
| 16 |
-
|
| 17 |
"""
|
| 18 |
-
|
| 19 |
-
prompt_templates = yaml.safe_load(stream)
|
| 20 |
-
return str(prompt_templates)
|
| 21 |
|
| 22 |
@tool
|
| 23 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -56,7 +54,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 56 |
|
| 57 |
agent = CodeAgent(
|
| 58 |
model=model,
|
| 59 |
-
tools=[final_answer,
|
| 60 |
max_steps=6,
|
| 61 |
verbosity_level=1,
|
| 62 |
grammar=None,
|
|
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
+
def say_hi_with_chinese(name:str)-> str: #it's import to specify the return type
|
| 13 |
#Keep this format for the description / args description but feel free to modify the tool
|
| 14 |
+
"""A tool that say hi with chinese
|
| 15 |
Args:
|
| 16 |
+
name: username
|
| 17 |
"""
|
| 18 |
+
return f"你好,我是你的智能小助手ted,很高兴认识你,{name}"
|
|
|
|
|
|
|
| 19 |
|
| 20 |
@tool
|
| 21 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 54 |
|
| 55 |
agent = CodeAgent(
|
| 56 |
model=model,
|
| 57 |
+
tools=[final_answer, say_hi_with_chinese, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
| 58 |
max_steps=6,
|
| 59 |
verbosity_level=1,
|
| 60 |
grammar=None,
|