Coming from the assistants api to the new Responses + Chat Prompts + Conversations API… I have found a very slight problem with file search.
When using the assistants api with file search enabled and a simple system instruction to show the cited sources it works well and shows a “【4:14†source】” after each sourced sentence or paragraph.
The problem: I have rebuilt my use case from assistants api to the Responses API with the new “Chat Prompt”, Same instructions, same file search tool, but it will not cite the sources no matter what i write in the system instructions.
Reason why i need this: I strictly only want answers from the file search, the “【4:14†source】” is my way of making sure the answers are coming from file search and not just chatgpt.
Has anyone else experienced this, know a fix of is it a bug?
Also, i really dont understand why OpenAI did this transition from assistants to responses with Chat prompt and conversations. It pretty much the exact same thing but with different names conversation id = thread ID / Chat prompt = assistant.
The method for sources written by the AI is now different for AI-written citations in Responses.
The citations, now instructed to be in a different format you don’t see, are now detected by the backend and stripped out completely.
You get an “index” range of character counts where they were located that you can highlight and link yourself.
Add the API parameter to include citable chunks in the output list of types you can use directly:
include=["file_search_call.results"]
Look in the “output” list the API will return:
{
"id": "msg_123456",
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The citations, now instructed to be in a different format you don't see, are now detected by the backend and stripped out completely....",
"annotations": [
{
"type": "file_citation",
"index": 70,
"file_id": "file-jtDKS8gDi",
"filename": "responses_annotations.pdf"
},
{
"type": "file_citation", ...
employ the index position and the markup information you want to give, in your own format that might be specific to an app without internet access.