Update utils.py
Browse files
utils.py
CHANGED
@@ -310,13 +310,13 @@ def rag_chain(llm, prompt, retriever):
|
|
310 |
relevant_docs = retriever.get_relevant_documents(prompt)
|
311 |
print("releant docs1......................")
|
312 |
if (len(relevant_docs)>0):
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
|
321 |
return result
|
322 |
|
|
|
310 |
relevant_docs = retriever.get_relevant_documents(prompt)
|
311 |
print("releant docs1......................")
|
312 |
if (len(relevant_docs)>0):
|
313 |
+
print("releant docs2......................")
|
314 |
+
print(relevant_docs)
|
315 |
+
llm_chain = LLMChain(llm = llm, prompt = RAG_CHAIN_PROMPT)
|
316 |
+
result = llm_chain.run({"context": relevant_docs, "question": neu_prompt})
|
317 |
+
else:
|
318 |
+
# keine relevanten Dokumente gefunden
|
319 |
+
result = "Keine relevanten Dokumente gefunden"
|
320 |
|
321 |
return result
|
322 |
|