Hey folks, I’ve been trying to use the new file_search tool, but the way annotations work, I can’t actually get the text that led to the annotation. An annotation looks like this:
file_id: "..."
filename: "...."
index: 1535
type: "file_citation"
Note the index. What is that index supposed to be? How am I supposed to use it?
I uploaded a docx file, and the index in the docx file probably doesn’t make sense (it would just be a random by of zipped data) – presumably it gets converted into markdown server side and that’s the index there.
So I tried to retrieve the file so I could work out what the index was, but I got a 400 error telling me that “user_data” files can’t be directly downloaded. How am I then supposed to use the index?
I even tried to include the full results of the file search (included in result.complete, in the output.result[<file_search].result, and see if I can match them there and at least include the bit from the file search, but there is no actual field linking the two together. I have no actual way of telling which search result was actually used – the only linking thing is the file_id, but there can be multiple results from the same file.
Index can’t be the index of the result, because it’s usually a big number like 1536, and typically I limit file_search results to 20.