Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,16 +49,16 @@ def generate_surfer_image(next_tide: str) -> str:
|
|
49 |
@tool
|
50 |
def display_image_tool(image: Union[Image.Image, str]) -> None:
|
51 |
"""
|
52 |
-
|
53 |
|
54 |
Args:
|
55 |
-
image
|
56 |
-
- A PIL Image object
|
57 |
-
- A URL string (starting with "http")
|
58 |
-
- A Base64-encoded image string (starting with "data:image")
|
59 |
-
|
60 |
Returns:
|
61 |
-
None.
|
|
|
|
|
|
|
|
|
62 |
"""
|
63 |
if isinstance(image, Image.Image):
|
64 |
# If it's a PIL Image, display it directly
|
|
|
49 |
@tool
|
50 |
def display_image_tool(image: Union[Image.Image, str]) -> None:
|
51 |
"""
|
52 |
+
Display an image in different formats.
|
53 |
|
54 |
Args:
|
55 |
+
image: The image to display. It can be a PIL Image object; a URL string (starting with "http"), a Base64-encoded image string (starting with "data:image").
|
|
|
|
|
|
|
|
|
56 |
Returns:
|
57 |
+
None: The function does not return anything. It displays the image in the notebook or script.
|
58 |
+
|
59 |
+
Raises:
|
60 |
+
ValueError: If the string format is not a valid image URL or Base64 string.
|
61 |
+
TypeError: If the input is not a PIL Image or a string.
|
62 |
"""
|
63 |
if isinstance(image, Image.Image):
|
64 |
# If it's a PIL Image, display it directly
|