Anne31415 commited on
Commit
236555b
·
verified ·
1 Parent(s): be98b8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -254,11 +254,17 @@ def page1():
254
  with st.spinner('Bot is thinking...'):
255
  chain = load_chatbot()
256
  docs = VectorStore.similarity_search(query=query, k=5)
257
- with get_openai_callback() as cb:
258
- response = chain.run(input_documents=docs, question=query)
259
- response = handle_no_answer(response) # Process the response through the new function
260
 
 
 
261
 
 
 
 
 
 
 
 
262
 
263
  # Stop timing
264
  end_time = time.time()
 
254
  with st.spinner('Bot is thinking...'):
255
  chain = load_chatbot()
256
  docs = VectorStore.similarity_search(query=query, k=5)
 
 
 
257
 
258
+ # Kombiniere den standardmäßigen Prompt mit der Benutzeranfrage
259
+ full_query = chain.llm.prompt + " " + query # Achte darauf, wie der Prompt und die Benutzeranfrage kombiniert werden
260
 
261
+ with get_openai_callback() as cb:
262
+ # Übergib die kombinierte Anfrage an die run-Funktion
263
+ response = chain.run(input_documents=docs, question=full_query)
264
+ response = handle_no_answer(response) # Verarbeite die Antwort durch die neue Funktion
265
+
266
+
267
+
268
 
269
  # Stop timing
270
  end_time = time.time()