Spaces:
Sleeping
Sleeping
arman77mxx
commited on
Commit
•
a50c887
1
Parent(s):
5f28d3a
up
Browse files
app.py
CHANGED
@@ -71,7 +71,10 @@ if OPENAI_API_KEY:
|
|
71 |
# Definición del pipeline de procesamiento
|
72 |
def rag_pipeline(question):
|
73 |
response = query_engine.query(question)
|
74 |
-
|
|
|
|
|
|
|
75 |
|
76 |
context = "\n\n".join(doc.text for doc in context_docs)
|
77 |
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 |
+
if hasattr(response, 'documents'):
|
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:"
|