Referencing an attached .csv in a OpenAI/GPT Prompt

Hello - I’m trying to use the OpenAI module to send a prompt that makes reference to an attached .csv file as a data source. This is not directly obvious how to do directly within the module. Does anyone have any way of pulling this off?

Hi @Christopher_Sanford and welcome to Make!

Hmmm…

I believe that support for RAG (attaching files) requires you to use an assistant instead of simply doing a completion (a chat). But to do that, you need to create your assistant first and attach the CSV in it (as part of your knowledge base).

However, if you’re sending the CSV at run time (like you would do during a ChatGPT session) it’s more complex.

There is a discussion here about this:

L

In addition to OpenAI assistants API, if you want to stick with simple chat competitions, try putting the CSV contents (which is comma separated text) in the body of your User or System message. LLMs are pretty handy at figuring out what to do with it.

2 Likes

Yeah, that’s MUCH easier!

L

I have worked with getting assistants to access files and can confirm that what drnic is saying would be a much easier solution espceically if you arent familair with the OpenAI playground and want to keep it simple

1 Like