Spaces:
Sleeping
Sleeping
Update pipeline.py
Browse files- pipeline.py +4 -0
pipeline.py
CHANGED
|
@@ -179,6 +179,10 @@ def do_web_search(query: str) -> str:
|
|
| 179 |
def run_with_chain(query: str) -> str:
|
| 180 |
print("DEBUG: Starting run_with_chain...")
|
| 181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
# 1) Moderate the query for harmful content
|
| 183 |
moderated_query = moderate_text(query)
|
| 184 |
if moderated_query == "OutOfScope":
|
|
|
|
| 179 |
def run_with_chain(query: str) -> str:
|
| 180 |
print("DEBUG: Starting run_with_chain...")
|
| 181 |
|
| 182 |
+
|
| 183 |
+
# Ensure the query is a string
|
| 184 |
+
query = str(query).strip()
|
| 185 |
+
|
| 186 |
# 1) Moderate the query for harmful content
|
| 187 |
moderated_query = moderate_text(query)
|
| 188 |
if moderated_query == "OutOfScope":
|