Spaces:
Sleeping
Sleeping
arman77mxx
commited on
Commit
•
a6933a9
1
Parent(s):
a50c887
up
Browse files
app.py
CHANGED
@@ -71,10 +71,7 @@ if OPENAI_API_KEY:
|
|
71 |
# Definición del pipeline de procesamiento
|
72 |
def rag_pipeline(question):
|
73 |
response = query_engine.query(question)
|
74 |
-
|
75 |
-
context_docs = response.documents
|
76 |
-
else:
|
77 |
-
context_docs = response # En caso de que response ya sea una lista de documentos
|
78 |
|
79 |
context = "\n\n".join(doc.text for doc in context_docs)
|
80 |
prompt = f"Contexto:\n{context}\n\nPregunta: {question}\nRespuesta:"
|
|
|
71 |
# Definición del pipeline de procesamiento
|
72 |
def rag_pipeline(question):
|
73 |
response = query_engine.query(question)
|
74 |
+
context_docs = response.get_documents() # Obtener documentos correctamente
|
|
|
|
|
|
|
75 |
|
76 |
context = "\n\n".join(doc.text for doc in context_docs)
|
77 |
prompt = f"Contexto:\n{context}\n\nPregunta: {question}\nRespuesta:"
|