Assistant API Annotations

Can anyone explain what the start_index and end_index are for? They don’t appear to match the index locations of the quotes from within any file (if using file_search).

In the annotation list, are they listed in chronological of where they appear in the assistant response text? Does the first entry in the annotations array correspond to the first instance in the content[0].text.value and so on?

Example:

"content": [
	{
		"type": "text",
		"text": {
			"value": "Lorem ipsum dolor sit amet?6:4+source?. Ut enim ad minim veniam?6:4+source?. Excepteur sint occaecat est laborum.?8:0+source?",
			"annotations": [
				{
					"type": "file_citation",
					"text": "?6:4+source?",
					"start_index": 632,
					"end_index": 694,
					"file_citation": {
						"file_id": "file-111111111111111111111111"
					}
				},
				{
					"type": "file_citation",
					"text": "?6:4+source?",
					"start_index": 1038,
					"end_index": 1100,
					"file_citation": {
						"file_id": "file-111111111111111111111111"
					}
				},
				{
					"type": "file_citation",
					"text": "?8:0+source?",
					"start_index": 1283,
					"end_index": 1326,
					"file_citation": {
						"file_id": "file-222222222222222222222222"
					}
				}
			]
		}
	}
]

Thanks!

2 Likes

They represent the start and end index of the string to be replaced (amet?6:4+source?) in the response text generated (text.value).

1 Like

Is there any way to prompt the assistant to return the location (page #, paragraph #, etc) from within a file from which the assistant “found” the answer to your prompt? Is there a timeline on when quotes are going to be added back to the v2 assistants?

Thanks.

1 Like

Unfortunately, no there isn’t and I don’t have a timeline I can share for more granular citations at the moment.