Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -354,7 +354,9 @@ def page2():
|
|
| 354 |
query = "Wie viele Patienten eines Grund- und Regelversorgers kommen aus welcher Fahrzeitzone?"
|
| 355 |
|
| 356 |
|
|
|
|
| 357 |
if query:
|
|
|
|
| 358 |
st.session_state['chat_history_page2'].append(("User", query, "new"))
|
| 359 |
|
| 360 |
# Start timing
|
|
@@ -364,10 +366,8 @@ def page2():
|
|
| 364 |
chain = load_chatbot()
|
| 365 |
docs = VectorStore.similarity_search(query=query, k=5)
|
| 366 |
with get_openai_callback() as cb:
|
| 367 |
-
response = chain.run(input_documents=docs, question=
|
| 368 |
response = handle_no_answer(response) # Process the response through the new function
|
| 369 |
-
|
| 370 |
-
|
| 371 |
|
| 372 |
# Stop timing
|
| 373 |
end_time = time.time()
|
|
@@ -466,7 +466,9 @@ def page3():
|
|
| 466 |
query = "Wie hoch sind die Gesamtkosten der Krankenhäuser pro Jahr?"
|
| 467 |
|
| 468 |
|
|
|
|
| 469 |
if query:
|
|
|
|
| 470 |
st.session_state['chat_history_page3'].append(("User", query, "new"))
|
| 471 |
|
| 472 |
# Start timing
|
|
@@ -476,10 +478,8 @@ def page3():
|
|
| 476 |
chain = load_chatbot()
|
| 477 |
docs = VectorStore.similarity_search(query=query, k=5)
|
| 478 |
with get_openai_callback() as cb:
|
| 479 |
-
response = chain.run(input_documents=docs, question=
|
| 480 |
response = handle_no_answer(response) # Process the response through the new function
|
| 481 |
-
|
| 482 |
-
|
| 483 |
|
| 484 |
# Stop timing
|
| 485 |
end_time = time.time()
|
|
|
|
| 354 |
query = "Wie viele Patienten eines Grund- und Regelversorgers kommen aus welcher Fahrzeitzone?"
|
| 355 |
|
| 356 |
|
| 357 |
+
|
| 358 |
if query:
|
| 359 |
+
full_query = ask_bot(query)
|
| 360 |
st.session_state['chat_history_page2'].append(("User", query, "new"))
|
| 361 |
|
| 362 |
# Start timing
|
|
|
|
| 366 |
chain = load_chatbot()
|
| 367 |
docs = VectorStore.similarity_search(query=query, k=5)
|
| 368 |
with get_openai_callback() as cb:
|
| 369 |
+
response = chain.run(input_documents=docs, question=full_query)
|
| 370 |
response = handle_no_answer(response) # Process the response through the new function
|
|
|
|
|
|
|
| 371 |
|
| 372 |
# Stop timing
|
| 373 |
end_time = time.time()
|
|
|
|
| 466 |
query = "Wie hoch sind die Gesamtkosten der Krankenhäuser pro Jahr?"
|
| 467 |
|
| 468 |
|
| 469 |
+
|
| 470 |
if query:
|
| 471 |
+
full_query = ask_bot(query)
|
| 472 |
st.session_state['chat_history_page3'].append(("User", query, "new"))
|
| 473 |
|
| 474 |
# Start timing
|
|
|
|
| 478 |
chain = load_chatbot()
|
| 479 |
docs = VectorStore.similarity_search(query=query, k=5)
|
| 480 |
with get_openai_callback() as cb:
|
| 481 |
+
response = chain.run(input_documents=docs, question=full_query)
|
| 482 |
response = handle_no_answer(response) # Process the response through the new function
|
|
|
|
|
|
|
| 483 |
|
| 484 |
# Stop timing
|
| 485 |
end_time = time.time()
|