#Can’t update files in thread

1 messages · Page 1 of 1 (latest)

stray sundial
#

Hi everyone!

We are unable to attach new files to old threads.
We update the thread using this method: /docs/api-reference/threads/modifyThread
We pass the vector store thread with all the files, but if you request this thread using the /docs/api-reference/threads/getThread method, then there is no information about the linked files\vector stores.

object(Bitrix\Main\Result)#2409 (3) {
["isSuccess":protected]=>
bool(true)
["errors":protected]=>
object(Bitrix\Main\ErrorCollection)#2406 (1) {
["values":protected]=>
array(0) {
}
}
["data":protected]=>
array(1) {
["result"]=>
array(5) {
["id"]=>
string(31) "thread_1gTAhBlG0siDKaMxhMOKjkdr"
["object"]=>
string(6) "thread"
["created_at"]=>
int(1719307663)
["metadata"]=>
array(0) {
}
["tool_resources"]=>
array(2) {
["file_search"]=>
array(1) {
["vector_store_ids"]=>
array(1) {
[0]=>
string(27) "vs_seyjYbX3Ydkh2OPBEypMJwQn"
}
}
}
}
}

this is the answer after updating the thread with the method /docs/api-reference/threads/modifyThread
We see that the vector store is attached

in the thread itself you can also see that there are files. But at the same time, the Assistant responds in dialogue with the user that he does not have access to these files.

#

Request to add a vector storage to a thread

POST https://api.openai.com/v1/threads/thread_1gTAhBlG0siDKaMxhMOKjkdr body: {"tool_resources":{"file_search":{"vector_store_ids":["vs_seyjYbX3Ydkh2OPBEypMJwQn"]}}}
Response: { "id": "thread_1gTAhBlG0siDKaMxhMOKjkdr", "object": "thread", "created_at": 1719307663, "metadata": {}, "tool_resources": { "file_search": { "vector_store_ids": [ "vs_seyjYbX3Ydkh2OPBEypMJwQn" ] }, "code_interpreter": { "file_ids": [ "file-PmpJBjhwHnqVTiENiKxmzhT3", "file-HkxbcEsq0MkKGoqArrIYhH9W" ] } }

Launching the runner

POST https://api.openai.com/v1/threads/thread_1gTAhBlG0siDKaMxhMOKjkdr/runs body: {"assistant_id":"asst_idvcXonw2wKlUmBOJrvILIoO","tools":[{"type":"file_search"}]}

Response: { "id": "run_TAkAnsRRAFKrv5IQEFAd01wd", "object": "thread.run", "created_at": 1721131397, "assistant_id": "asst_idvcXonw2wKlUmBOJrvILIoO", "thread_id": "thread_1gTAhBlG0siDKaMxhMOKjkdr", "status": "queued", "started_at": null, "expires_at": 1721131997, "cancelled_at": null, "failed_at": null, "completed_at": null, "required_action": null, "last_error": null, "model": "gpt-4-turbo-2024-04-09", "instructions": "(OK instructions here, removed for clean answer)", "tools": [ { "type": "file_search" } ], "tool_resources": {}, "metadata": {}, "temperature": 1.0, "top_p": 1.0, "max_completion_tokens": null, "max_prompt_tokens": null, "truncation_strategy": { "type": "auto", "last_messages": null }, "incomplete_details": null, "usage": null, "response_format": "auto", "tool_choice": "auto", "parallel_tool_calls": true }