Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import datetime
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
|
|
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
|
@@ -57,7 +58,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 57 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 58 |
|
| 59 |
@tool
|
| 60 |
-
def generate_travel_brochure_image(description: str) ->
|
| 61 |
"""A tool that generates a travel brochure image based on a description.
|
| 62 |
Args:
|
| 63 |
description: A string representing text to be converted into a brochure.
|
|
@@ -85,10 +86,10 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 85 |
agent = CodeAgent(
|
| 86 |
model=model,
|
| 87 |
tools=[
|
| 88 |
-
final_answer,
|
| 89 |
get_current_time_in_timezone,
|
| 90 |
travel_recommendations_for_city,
|
| 91 |
-
generate_travel_brochure_image
|
|
|
|
| 92 |
], ## add your tools here (don't remove final answer)
|
| 93 |
max_steps=6,
|
| 94 |
verbosity_level=1,
|
|
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
+
from PIL import Image
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
|
|
|
| 58 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 59 |
|
| 60 |
@tool
|
| 61 |
+
def generate_travel_brochure_image(description: str) -> Image.Image:
|
| 62 |
"""A tool that generates a travel brochure image based on a description.
|
| 63 |
Args:
|
| 64 |
description: A string representing text to be converted into a brochure.
|
|
|
|
| 86 |
agent = CodeAgent(
|
| 87 |
model=model,
|
| 88 |
tools=[
|
|
|
|
| 89 |
get_current_time_in_timezone,
|
| 90 |
travel_recommendations_for_city,
|
| 91 |
+
generate_travel_brochure_image,
|
| 92 |
+
final_answer
|
| 93 |
], ## add your tools here (don't remove final answer)
|
| 94 |
max_steps=6,
|
| 95 |
verbosity_level=1,
|