Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,10 @@ def currency_converter(amount: float, from_currency: str, to_currency: str) -> s
|
|
37 |
|
38 |
@tool
|
39 |
def website_availability(url: str) -> str:
|
40 |
-
"""Check if a website is online and responsive
|
|
|
|
|
|
|
41 |
try:
|
42 |
response = requests.get(url, timeout=5)
|
43 |
return f"Website {url} is online (Status: {response.status_code})"
|
@@ -46,13 +49,15 @@ def website_availability(url: str) -> str:
|
|
46 |
|
47 |
@tool
|
48 |
def text_summarizer(long_text: str) -> str:
|
49 |
-
"""Summarize long text documents
|
|
|
|
|
|
|
50 |
try:
|
51 |
-
# For production: Integrate with Hugging Face summarization pipeline
|
52 |
sentences = long_text.split('.')
|
53 |
-
return '. '.join(sentences[:3]) + '...'
|
54 |
except Exception as e:
|
55 |
-
return f"Error summarizing
|
56 |
|
57 |
|
58 |
@tool
|
|
|
37 |
|
38 |
@tool
|
39 |
def website_availability(url: str) -> str:
|
40 |
+
"""Check if a website is online and responsive
|
41 |
+
Args:
|
42 |
+
url: The full URL of the website to check (including protocol like https://)
|
43 |
+
"""
|
44 |
try:
|
45 |
response = requests.get(url, timeout=5)
|
46 |
return f"Website {url} is online (Status: {response.status_code})"
|
|
|
49 |
|
50 |
@tool
|
51 |
def text_summarizer(long_text: str) -> str:
|
52 |
+
"""Summarize long text documents
|
53 |
+
Args:
|
54 |
+
long_text: The text content to summarize (at least 3 sentences)
|
55 |
+
"""
|
56 |
try:
|
|
|
57 |
sentences = long_text.split('.')
|
58 |
+
return '. '.join(sentences[:3]) + '...'
|
59 |
except Exception as e:
|
60 |
+
return f"Error summarizing text"
|
61 |
|
62 |
|
63 |
@tool
|