SciPhi-AI / R2R

The all-in-one solution for RAG. Build, scale, and deploy state of the art Retrieval-Augmented Generation applications
https://r2r-docs.sciphi.ai/
MIT License
3.54k stars 265 forks source link

browsing ingested documents is not working #1009

Closed jonabert closed 2 months ago

jonabert commented 2 months ago

last version r2r 3.0.8 running from command line (non-docker) when I run this python snippet from r2r import R2RClient

Initialize the R2R client

client = R2RClient("http://localhost:8000")

If using authentication, uncomment the next line and add your credentials

client.login(...)

Retrieve the documents overview

documents_overview = client.documents_overview()

Print information about each document

for doc in documents_overview: print(f"Document ID: {doc['document_id']}") print(f"Title: {doc['title']}") print(f"Version: {doc['version']}") print(f"Size: {doc['size_in_bytes']} bytes") print(f"Status: {doc['status']}") print(f"Created at: {doc['created_at']}") print(f"Updated at: {doc['updated_at']}") print(f"Metadata: {doc['metadata']}") print("---")

I get (base) jonathan@GAMER005:~/r2r/r2r-local-dev/py$ poetry run python testsetup.py Traceback (most recent call last): File "/home/jonathan/r2r/r2r-local-dev/py/testsetup.py", line 13, in print(f"Document ID: {doc[document_id]}") ^^^^^^^^^^^ NameError: name 'document_id' is not defined (base) jonathan@GAMER005:~/r2r/r2r-local-dev/py$

emrgnt-cmplxty commented 2 months ago

Can you try accessing just 'id' instead?