Send LLM input to RAG in python


I’m looking at this article but I fail to find the option to give a list of files as LLM input - where does this take place ?

Hey there!

So, peeking through this guide, it’s a little bit…lacking in the finer details, so I don’t blame you for wondering.

It’s described in that guide as this:

Prepare Prompt and Knowledge Base:

  • Prompt: Your question or task (e.g., “Summarize the scientific evidence for climate change.”)
  • Knowledge Base: A JSON file, database, or API access to relevant documents.
inputs = tokenizer(your_prompt, return_tensors="pt")
retrieval_output = model.get_retrieval_vector(inputs)

If you’re not already familiar with this kind of stuff, this probably looks like french at this point (which oddly defeats the purpose of the guide).

How about you check out this tutorial from the OpenAI cookbook? I personally find OpenAI’s cookbook to be the best quality tutorials out there for their APIs. I would start here instead.