Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,20 +21,17 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 21 |
|
| 22 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 23 |
|
| 24 |
-
from smolagents.agent_types import AgentImage
|
| 25 |
-
|
| 26 |
|
| 27 |
@tool
|
| 28 |
-
def generate_image(prompt: str) ->
|
| 29 |
"""Génère une image à partir d'une description textuelle.
|
| 30 |
|
| 31 |
Args:
|
| 32 |
prompt (str): Une description de l'image à générer.
|
| 33 |
"""
|
| 34 |
|
| 35 |
-
|
| 36 |
-
return
|
| 37 |
-
|
| 38 |
|
| 39 |
@tool
|
| 40 |
def Searchtool(question: str) -> str:
|
|
|
|
| 21 |
|
| 22 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 23 |
|
|
|
|
|
|
|
| 24 |
|
| 25 |
@tool
|
| 26 |
+
def generate_image(prompt: str) -> str:
|
| 27 |
"""Génère une image à partir d'une description textuelle.
|
| 28 |
|
| 29 |
Args:
|
| 30 |
prompt (str): Une description de l'image à générer.
|
| 31 |
"""
|
| 32 |
|
| 33 |
+
img_obj = image_generation_tool(prompt) # AgentImage
|
| 34 |
+
return img_obj.url
|
|
|
|
| 35 |
|
| 36 |
@tool
|
| 37 |
def Searchtool(question: str) -> str:
|