Update app.py
Browse files
app.py
CHANGED
@@ -42,8 +42,6 @@ class_time = st.slider(
|
|
42 |
"Filter Class Times:",
|
43 |
value=(t(11, 30), t(12, 45)))
|
44 |
|
45 |
-
# st.write("You're scheduled for:", class_time)
|
46 |
-
|
47 |
units = st.slider(
|
48 |
"Number of units",
|
49 |
1, 4,
|
@@ -62,9 +60,15 @@ def get_rag_results(prompt):
|
|
62 |
'''
|
63 |
query = prompt
|
64 |
response = filter_agent(prompt, OPENAI_API)
|
|
|
|
|
|
|
|
|
|
|
65 |
response = index.query(
|
66 |
vector = embeddings.embed_query(query),
|
67 |
top_k = 25,
|
|
|
68 |
include_metadata = True
|
69 |
)
|
70 |
response = reranker(query, response) # BERT cross encoder for ranking
|
|
|
42 |
"Filter Class Times:",
|
43 |
value=(t(11, 30), t(12, 45)))
|
44 |
|
|
|
|
|
45 |
units = st.slider(
|
46 |
"Number of units",
|
47 |
1, 4,
|
|
|
60 |
'''
|
61 |
query = prompt
|
62 |
response = filter_agent(prompt, OPENAI_API)
|
63 |
+
query_filter = {
|
64 |
+
"Units": str(int(units)) + ".0 units",
|
65 |
+
"start": ${"gte": str(class_time[0])},
|
66 |
+
"end": ${"lte": str(class_time[1])}
|
67 |
+
}
|
68 |
response = index.query(
|
69 |
vector = embeddings.embed_query(query),
|
70 |
top_k = 25,
|
71 |
+
# filter = query_filter,
|
72 |
include_metadata = True
|
73 |
)
|
74 |
response = reranker(query, response) # BERT cross encoder for ranking
|