Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -28,14 +28,18 @@ def invoke(openai_api_key, prompt, rag_option):
|
|
28 |
if (RAG_INGESTION):
|
29 |
return rag_ingestion(collection)
|
30 |
else:
|
31 |
-
###
|
|
|
|
|
32 |
match_stage = {
|
33 |
"$match": {
|
34 |
-
|
|
|
35 |
}
|
36 |
}
|
37 |
|
38 |
additional_stages = [match_stage]
|
|
|
39 |
###
|
40 |
|
41 |
search_results = rag_retrieval(openai_api_key, prompt, db, collection, additional_stages)
|
|
|
28 |
if (RAG_INGESTION):
|
29 |
return rag_ingestion(collection)
|
30 |
else:
|
31 |
+
### Pre-retrieval processing: index filter
|
32 |
+
### Post-retrieval processing: result filter
|
33 |
+
"""
|
34 |
match_stage = {
|
35 |
"$match": {
|
36 |
+
"address.country": re.compile(r"United States"),
|
37 |
+
"accommodates": { "$gt": 1, "$lt": 3}
|
38 |
}
|
39 |
}
|
40 |
|
41 |
additional_stages = [match_stage]
|
42 |
+
"""
|
43 |
###
|
44 |
|
45 |
search_results = rag_retrieval(openai_api_key, prompt, db, collection, additional_stages)
|