Update app.py
Browse files
app.py
CHANGED
|
@@ -18,14 +18,14 @@ def is_prime_number(n:int)-> str: #it's import to specify the return type
|
|
| 18 |
n: An integer to be tested for primality.
|
| 19 |
"""
|
| 20 |
try:
|
| 21 |
-
if
|
| 22 |
-
return f"{
|
| 23 |
-
for i in range(2, int(
|
| 24 |
-
if
|
| 25 |
-
return f"{
|
| 26 |
-
return f"{
|
| 27 |
except Exception as e:
|
| 28 |
-
return f"Error checking primality for '{
|
| 29 |
|
| 30 |
@tool
|
| 31 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 18 |
n: An integer to be tested for primality.
|
| 19 |
"""
|
| 20 |
try:
|
| 21 |
+
if n <= 1:
|
| 22 |
+
return f"{n} is not a prime number."
|
| 23 |
+
for i in range(2, int(n ** 0.5) + 1):
|
| 24 |
+
if n % i == 0:
|
| 25 |
+
return f"{n} is not a prime number."
|
| 26 |
+
return f"{n} is a prime number."
|
| 27 |
except Exception as e:
|
| 28 |
+
return f"Error checking primality for '{n}': {str(e)}"
|
| 29 |
|
| 30 |
@tool
|
| 31 |
def get_current_time_in_timezone(timezone: str) -> str:
|