Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,9 +11,14 @@ from Gradio_UI import GradioUI
|
|
| 11 |
|
| 12 |
@tool
|
| 13 |
def dog_average_longevity(breed: str) -> str:
|
| 14 |
-
"""
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
"""
|
| 18 |
query = f"average lifespan for {breed} dog in years"
|
| 19 |
|
|
@@ -28,6 +33,7 @@ def dog_average_longevity(breed: str) -> str:
|
|
| 28 |
|
| 29 |
return "No reliable lifespan information found. Please check with a veterinarian."
|
| 30 |
|
|
|
|
| 31 |
def extract_lifespan(text: str) -> Optional[str]:
|
| 32 |
"""
|
| 33 |
Extracts the first occurrence of a lifespan range or single number in years.
|
|
|
|
| 11 |
|
| 12 |
@tool
|
| 13 |
def dog_average_longevity(breed: str) -> str:
|
| 14 |
+
"""
|
| 15 |
+
A tool that uses DuckDuckGo to search the web and returns the average lifespan for a given dog breed.
|
| 16 |
+
|
| 17 |
+
Parameters:
|
| 18 |
+
breed (str): The breed of the dog (e.g., "Labrador").
|
| 19 |
+
|
| 20 |
+
Returns:
|
| 21 |
+
str: The average lifespan of the specified dog breed in years.
|
| 22 |
"""
|
| 23 |
query = f"average lifespan for {breed} dog in years"
|
| 24 |
|
|
|
|
| 33 |
|
| 34 |
return "No reliable lifespan information found. Please check with a veterinarian."
|
| 35 |
|
| 36 |
+
|
| 37 |
def extract_lifespan(text: str) -> Optional[str]:
|
| 38 |
"""
|
| 39 |
Extracts the first occurrence of a lifespan range or single number in years.
|