Copy and Pasting from attached file

Hi People,

I am trying to get the assistants api to directly input all the text (about 2 pages) from the attached file in it’s response but i am having great trouble doing this.

It only wants to include the headers of the text or significantly shortens the already small paragraphs.

Is there any way i can get the assistants api to copy and paste the the text from my attached files verbatim in it’s response?

Any help would be greatly appreciated.


You can’t use the file_search tool to do this at the moment – this tool is optimized to search for relevant snippets in your file (instead of reading the whole file).

If you’d like the contents of a file to be repeated, you’ll want to parse the contents of a file and put them into a Message before creating a Run.


Agree with @nikunj here.

If you want to make it part of your input messages on the thread, you can simply insert it into the message everytime.

Additionally, there’s no need to store the file on OpenAI’s storage and pay for the storage costs.

Hi thanks for the response.

In the user prompt? I’ve tried adding it into there and it doesn’t seem to want to completely repeat it in the ai’s response. Even when instructing the ai it must include the paragraphs in their entirety

The Assistants API is a dev product with its outputs meant to be consumed in your code.

If including part of the document verbatim in the output is your goal, you can do that simply by inserting it in the output string on your end.