CdC-SI / eak-copilot

The official repository of the EAK-Copilot project as part of the Innovation Fellowship 2024.
https://cdc-si.github.io/eak-copilot/
GNU General Public License v3.0
3 stars 0 forks source link

fix error list index out of range #235

Open K-Schubert opened 2 weeks ago

K-Schubert commented 2 weeks ago

Description

When no RAG data is indexed, retrieval fails with an "IndexError: list index out of range" in retrieve() method of /app/rag/app/rag_processor.py:

documents = [dict(row) for row in rows][0] will be an empty list.

Suggested fix

Either ensure data is always indexed for RAG, or check for empty list before slicing first element of list.