The OpenAI Assistants API v2 provides a stateful, multi-turn conversation framework with built-in tools like file search and code interpreter. Understanding threads, runs, vector stores, and the tool execution cycle is essential for building production AI assistants.
0 / 5 completed
1 / 5
In the OpenAI Assistants API v2, what is a Thread?
A Thread is the conversation container in the Assistants API. It holds all Messages (user, assistant, tool) and persists on OpenAI's servers, allowing stateful multi-turn conversations without the client managing history.
2 / 5
When you attach files to a Vector Store and enable the file_search tool, what does the API do with those files?
When you enable file_search, OpenAI chunks and embeds the files into a Vector Store. During a Run, the assistant can semantically search those embeddings to retrieve relevant passages, enabling RAG over large document collections.
3 / 5
A Run enters the requires_action status. What must your application do?
When a Run reaches requires_action, the assistant has called one or more tools and is waiting for results. Your application executes the tool calls and submits the results via submit_tool_outputs. The Run then continues to completion.
4 / 5
What changed about file attachments between Assistants API v1 and v2?
In v2, OpenAI decoupled file storage from the Assistant resource. Vector Stores are first-class resources you manage independently. Files are attached to Vector Stores, which are then linked to Assistants or Threads, giving much more control over retrieval scope.
5 / 5
The code_interpreter tool in an Assistant Run can write and execute Python code. In which environment does this code run?
The code_interpreter runs code in a sandboxed, server-side container provisioned by OpenAI per session. It has no internet access, cannot affect other sessions, and is discarded after the Thread session ends. It can read files from attached resources.