Update app.py
Browse files
app.py
CHANGED
@@ -43,19 +43,20 @@ def random_fact() -> str:
|
|
43 |
@tool
|
44 |
def generate_car_image() -> str:
|
45 |
"""
|
46 |
-
Generates an image of a car using
|
47 |
|
48 |
Returns:
|
49 |
A string containing the URL of the generated car image.
|
50 |
"""
|
51 |
-
# Define the prompt specifically for a car image
|
52 |
prompt = "A high-resolution image of a sleek modern car driving on a scenic road."
|
53 |
try:
|
54 |
-
|
|
|
55 |
return f"Here's your generated car image: {image_url}"
|
56 |
except Exception as e:
|
57 |
return f"Error generating car image: {str(e)}"
|
58 |
|
|
|
59 |
|
60 |
@tool
|
61 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
43 |
@tool
|
44 |
def generate_car_image() -> str:
|
45 |
"""
|
46 |
+
Generates an image of a car using the text-to-image generation tool.
|
47 |
|
48 |
Returns:
|
49 |
A string containing the URL of the generated car image.
|
50 |
"""
|
|
|
51 |
prompt = "A high-resolution image of a sleek modern car driving on a scenic road."
|
52 |
try:
|
53 |
+
# Instead of .run(prompt), call the tool directly as a function.
|
54 |
+
image_url = image_generation_tool(prompt)
|
55 |
return f"Here's your generated car image: {image_url}"
|
56 |
except Exception as e:
|
57 |
return f"Error generating car image: {str(e)}"
|
58 |
|
59 |
+
|
60 |
|
61 |
@tool
|
62 |
def get_current_time_in_timezone(timezone: str) -> str:
|