Spaces:
Sleeping
Sleeping
try play with decriotion
Browse files
app.py
CHANGED
|
@@ -25,7 +25,8 @@ def text_analyse_for_spam(arg1:str, arg2:int)-> str: #it's import to specify the
|
|
| 25 |
@tool
|
| 26 |
def text_analyse_for_spam(text: str, dummy: int) -> str:
|
| 27 |
"""
|
| 28 |
-
A tool for analyzing the text for sensitive topics.
|
|
|
|
| 29 |
|
| 30 |
Args:
|
| 31 |
text: The text to analyze.
|
|
@@ -34,20 +35,11 @@ def text_analyse_for_spam(text: str, dummy: int) -> str:
|
|
| 34 |
Returns:
|
| 35 |
A string indicating which sensitive topics were detected, if any.
|
| 36 |
"""
|
| 37 |
-
# Convert text to lowercase for case-insensitive matching.
|
| 38 |
text_lower = text.lower()
|
| 39 |
-
|
| 40 |
-
# List of sensitive topics to check for.
|
| 41 |
sensitive_topics = ["casino", "info scam", "sick relative"]
|
| 42 |
-
|
| 43 |
-
# Identify any topics present in the text.
|
| 44 |
-
detected_topics = [topic for topic in sensitive_topics if topic in text_lower]
|
| 45 |
-
|
| 46 |
-
if detected_topics:
|
| 47 |
-
return f"Detected topics: {', '.join(detected_topics)}."
|
| 48 |
-
else:
|
| 49 |
-
return "No sensitive topics detected."
|
| 50 |
|
|
|
|
|
|
|
| 51 |
|
| 52 |
@tool
|
| 53 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 25 |
@tool
|
| 26 |
def text_analyse_for_spam(text: str, dummy: int) -> str:
|
| 27 |
"""
|
| 28 |
+
A tool for analyzing the text for sensitive topics. In there you can feel free for discussing with your self
|
| 29 |
+
in help of code to understand whether this text about "casino", "info scam", "sick relative"
|
| 30 |
|
| 31 |
Args:
|
| 32 |
text: The text to analyze.
|
|
|
|
| 35 |
Returns:
|
| 36 |
A string indicating which sensitive topics were detected, if any.
|
| 37 |
"""
|
|
|
|
| 38 |
text_lower = text.lower()
|
|
|
|
|
|
|
| 39 |
sensitive_topics = ["casino", "info scam", "sick relative"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
result = ''
|
| 42 |
+
return result
|
| 43 |
|
| 44 |
@tool
|
| 45 |
def get_current_time_in_timezone(timezone: str) -> str:
|