Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -36,27 +36,27 @@ def invoke(openai_api_key, prompt, rag_option):
|
|
36 |
|
37 |
if (RAG_INGESTION):
|
38 |
rag_ingestion(collection)
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
50 |
}
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
#result = handle_user_query(openai_api_key, query, db, collection, additional_stages)
|
59 |
-
return handle_user_prompt(openai_api_key, prompt, db, collection)
|
60 |
|
61 |
gr.close_all()
|
62 |
|
|
|
36 |
|
37 |
if (RAG_INGESTION):
|
38 |
rag_ingestion(collection)
|
39 |
+
return
|
40 |
+
else:
|
41 |
+
"""
|
42 |
+
print("777")
|
43 |
+
search_path = "address.country"
|
44 |
+
|
45 |
+
print("888")
|
46 |
+
# Create a match stage
|
47 |
+
match_stage = {
|
48 |
+
"$match": {
|
49 |
+
search_path: re.compile(r"United States"),
|
50 |
+
"accommodates": { "$gt": 1, "$lt": 3}
|
51 |
+
}
|
52 |
}
|
53 |
+
|
54 |
+
print("999")
|
55 |
+
additional_stages = [match_stage]
|
56 |
+
"""
|
57 |
+
|
58 |
+
#result = handle_user_query(openai_api_key, query, db, collection, additional_stages)
|
59 |
+
return rag_retrieval(openai_api_key, prompt, db, collection)
|
|
|
|
|
60 |
|
61 |
gr.close_all()
|
62 |
|