Hello everyone,
I’m using the ChatGPT Assistant API to build an app. In my app, I upload a .docx file to the files section, and the assistant searches in it.
The problem is that the responses always mention the file name, like [filename.docx] or [source]. I don’t want the assistant to reference the file or its name in the responses.
I tried adding this to the system prompt: “Do not reference document names or attached files in your responses. Do not mention the file search or give the user the file.”
Searching about it I’ve found the Assistant API is designed to cite sources like document names for transparency, and this behavior is hardcoded into the system. While system prompts can guide the assistant’s tone and style, they cannot override this core feature. As a result, completely removing citations from responses is not possible through prompt engineering alone.
For me the easiest workaround was to preprocess the assistant’s responses to remove references to file names programmatically using text-processing techniques, such as regular expressions, to strip out patterns like [filename.docx] or [source].