Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,19 +34,19 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
@tool
|
| 37 |
-
def does_file_exist(file_name: str) ->
|
| 38 |
"""
|
| 39 |
A tool that checks if a file exists in the current directory.
|
| 40 |
Args:
|
| 41 |
file_name: a string representing the file name to find.
|
| 42 |
|
| 43 |
Returns:
|
| 44 |
-
|
| 45 |
"""
|
| 46 |
try:
|
| 47 |
from pathlib import Path
|
| 48 |
file_path: Path = Path(f"./{file_name}")
|
| 49 |
-
return file_path.exists()
|
| 50 |
except Exception as e:
|
| 51 |
return f"Error finding the file {file_name}: {str(e)}"
|
| 52 |
|
|
|
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
@tool
|
| 37 |
+
def does_file_exist(file_name: str) -> str:
|
| 38 |
"""
|
| 39 |
A tool that checks if a file exists in the current directory.
|
| 40 |
Args:
|
| 41 |
file_name: a string representing the file name to find.
|
| 42 |
|
| 43 |
Returns:
|
| 44 |
+
str: returns True if the file exists else returns error message
|
| 45 |
"""
|
| 46 |
try:
|
| 47 |
from pathlib import Path
|
| 48 |
file_path: Path = Path(f"./{file_name}")
|
| 49 |
+
return f"Does the file {file_name} exists? {file_path.exists()}"
|
| 50 |
except Exception as e:
|
| 51 |
return f"Error finding the file {file_name}: {str(e)}"
|
| 52 |
|