Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,16 @@ def Searchtool(question: str) -> str:
|
|
| 27 |
"""
|
| 28 |
search_tool = DuckDuckGoSearchTool() # variable différente du nom de la fonction
|
| 29 |
response = search_tool(question)
|
| 30 |
-
return response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
|
| 33 |
@tool
|
|
@@ -67,7 +76,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 67 |
|
| 68 |
agent = CodeAgent(
|
| 69 |
model=model,
|
| 70 |
-
tools=[final_answer , Searchtool , get_current_time_in_timezone ], ## add your tools here (don't remove final answer)
|
| 71 |
max_steps=6,
|
| 72 |
verbosity_level=1,
|
| 73 |
grammar=None,
|
|
|
|
| 27 |
"""
|
| 28 |
search_tool = DuckDuckGoSearchTool() # variable différente du nom de la fonction
|
| 29 |
response = search_tool(question)
|
| 30 |
+
return response
|
| 31 |
+
|
| 32 |
+
@tool
|
| 33 |
+
def generate_image(prompt : str) -> str :
|
| 34 |
+
""" genere une image a partir d'une description textuelle .
|
| 35 |
+
Args :
|
| 36 |
+
prompt : une description de l'image a générer
|
| 37 |
+
returns : URL ou chemin de l'image générer """
|
| 38 |
+
|
| 39 |
+
return image_generation_tool(prompt)
|
| 40 |
|
| 41 |
|
| 42 |
@tool
|
|
|
|
| 76 |
|
| 77 |
agent = CodeAgent(
|
| 78 |
model=model,
|
| 79 |
+
tools=[final_answer , Searchtool , get_current_time_in_timezone , generate_image ], ## add your tools here (don't remove final answer)
|
| 80 |
max_steps=6,
|
| 81 |
verbosity_level=1,
|
| 82 |
grammar=None,
|