Skip to content

512-srv156-web110

@ekassos ekassos tagged this 05 Dec 19:34
Fixes #595 (and #317), where an assistant might not have visibility into
a files uploaded in a Thread's Vector Store.

## Background
OpenAI's [technical
notes](https://platform.openai.com/docs/assistants/tools/file-search#ensuring-vector-store-readiness-before-creating-runs)
state:

> **Ensuring vector store readiness before creating runs**
> We highly recommend that you ensure all files in a vector_store are
fully processed before you create a run. This will ensure that all the
data in your vector_store is searchable. You can check for vector_store
readiness by using the polling helpers in our SDKs, or by manually
polling the vector_store object to ensure the
[status](https://platform.openai.com/docs/api-reference/vector-stores/object#vector-stores/object-status)
is completed.
> 
> As a fallback, we've built a 60 second maximum wait in the Run object
when the thread’s vector store contains files that are still being
processed. This is to ensure that any files your users upload in a
thread a fully searchable before the run proceeds. This fallback wait
does not apply to the assistant's vector store.

It sounds like we should be doing the same, even though we're using
their helper `message` `attachments` parameter when creating a message.
However, as noted in #317, we no longer upload files ourselves at the
thread level, so we cannot use `create_and_poll` or `upload_and_poll`.
Instead, we have to call `poll` on every single file uploaded to the
vector store in the current message run.
Assets 2
Loading