Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -97,7 +97,9 @@ def vector_search(user_query, collection):
|
|
97 |
return list(results)
|
98 |
|
99 |
def mongo_retriever(query):
|
|
|
100 |
documents = vector_search(query, mongo_collection)
|
|
|
101 |
return documents
|
102 |
|
103 |
|
@@ -368,18 +370,13 @@ if uploaded_image and recipe_submit:
|
|
368 |
|
369 |
# Call the OpenAI API
|
370 |
openAIresponse = llm.invoke(openAICall)
|
371 |
-
print("AI CALL RESPONSE: ", openAIresponse.content)
|
372 |
|
373 |
-
print("AI CALL RESPONSE END")
|
374 |
RAGresponse = get_response(openAIresponse.content + " " + query)
|
375 |
print("RAGresponse: ", RAGresponse)
|
376 |
with st.expander("Recipe Generation", expanded=True, icon=':material/menu_book:'):
|
377 |
st.title('Results: RAG')
|
378 |
-
# RAG the openai response and display
|
379 |
-
print("RAG INPUT", openAIresponse.content + " " + query)
|
380 |
-
print("End rag input")
|
381 |
display_response(RAGresponse)
|
382 |
-
print("FINAL RAG RESPONSE", RAGresponse)
|
383 |
elif uploaded_image is not None:
|
384 |
with st.expander("**Food Classification**", expanded=True, icon=':material/search_insights:'):
|
385 |
st.title("Results: Image Classification")
|
|
|
97 |
return list(results)
|
98 |
|
99 |
def mongo_retriever(query):
|
100 |
+
print("mongo retriever query: ", query)
|
101 |
documents = vector_search(query, mongo_collection)
|
102 |
+
print("DOCuMENTS RETRIEVED: ", documents)
|
103 |
return documents
|
104 |
|
105 |
|
|
|
370 |
|
371 |
# Call the OpenAI API
|
372 |
openAIresponse = llm.invoke(openAICall)
|
373 |
+
print("AI CALL RESPONSE: ", openAIresponse.content, "END AI CALL RESONSE")
|
374 |
|
|
|
375 |
RAGresponse = get_response(openAIresponse.content + " " + query)
|
376 |
print("RAGresponse: ", RAGresponse)
|
377 |
with st.expander("Recipe Generation", expanded=True, icon=':material/menu_book:'):
|
378 |
st.title('Results: RAG')
|
|
|
|
|
|
|
379 |
display_response(RAGresponse)
|
|
|
380 |
elif uploaded_image is not None:
|
381 |
with st.expander("**Food Classification**", expanded=True, icon=':material/search_insights:'):
|
382 |
st.title("Results: Image Classification")
|