Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -194,10 +194,10 @@ guard = Guard().use(CustomPIIDetector).use(CustomProfanityDetector).use(CustomRe
|
|
| 194 |
|
| 195 |
# Define Chatbot Function
|
| 196 |
def chat_with_rag(message, history):
|
| 197 |
-
try:
|
| 198 |
-
|
| 199 |
-
except Exception as e:
|
| 200 |
-
|
| 201 |
try:
|
| 202 |
response = conversation_chain.invoke(message)
|
| 203 |
confidence_score = get_confidence_score(message)
|
|
|
|
| 194 |
|
| 195 |
# Define Chatbot Function
|
| 196 |
def chat_with_rag(message, history):
|
| 197 |
+
# try:
|
| 198 |
+
# res = guard.validate(message)
|
| 199 |
+
# except Exception as e:
|
| 200 |
+
# return f"❌ Guardrail {str(e)}"
|
| 201 |
try:
|
| 202 |
response = conversation_chain.invoke(message)
|
| 203 |
confidence_score = get_confidence_score(message)
|