Assistants is currently a beta API and allows one to incorporate OpenAI’s LLM functionality within one’s application.1

It takes instructions, and leverages models and tools to respond to a user’s query.

Integrating an Assistant

There are two ways to do so:

  1. Use the Assistants playground for a low-code approach
  2. Build it out manually using stack of choice

Manual integration

  1. Create an assistant, specifying the model, tools and instructions available to the assistant.
  2. Create a Thread, that holds history of a conversation.
  3. Convert a user query into a Message and attach it to the Thread.
  4. Invoke the LLM by creating a run for the given Thread.2

Pros and Cons

This approach abstracts away the complexity of handling the context window. In other words, users don’t have to worry nor do they have control over the context window, which may be more costly in long run since OpenAI will try to find as much context as possible into the window.

Concretely, this is handled by Threads.

Note

A existing assistant’s file association is always reset.

Footnotes

  1. This feels like a more constrained form LangChain, in terms of LLM provider as well as functionality

  2. Does the run mutate the Thread?