Update app.py
Browse files
app.py
CHANGED
@@ -129,9 +129,13 @@ if prompt := st.chat_input("What kind of class are you looking for?"):
|
|
129 |
messages = [{"role": m["role"], "content": m["content"]}
|
130 |
for m in st.session_state.messages]
|
131 |
message_history = " ".join([message["content"] for message in messages])
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
|
|
135 |
# '\n Additional Class Times:' + str(additional_metadata)
|
136 |
assistant_response = results_agent(result_query, OPENAI_API)
|
137 |
# assistant_response = openai.ChatCompletion.create(
|
|
|
129 |
messages = [{"role": m["role"], "content": m["content"]}
|
130 |
for m in st.session_state.messages]
|
131 |
message_history = " ".join([message["content"] for message in messages])
|
132 |
+
route = routing_agent(prompt, message_history)
|
133 |
+
|
134 |
+
if route == "0":
|
135 |
+
result_query = 'Original Query:' + prompt + '\nQuery Results: No query was made' + '\nMessage History' + str(message_history)
|
136 |
+
else:
|
137 |
+
rag_response, additional_metadata = get_rag_results(prompt)
|
138 |
+
result_query = 'Original Query:' + prompt + '\nQuery Results:' + str(rag_response) + '\nMessage History:' + str(message_history)
|
139 |
# '\n Additional Class Times:' + str(additional_metadata)
|
140 |
assistant_response = results_agent(result_query, OPENAI_API)
|
141 |
# assistant_response = openai.ChatCompletion.create(
|