OpenAI Assistants

OpenAI Dev Day 2023: Introduction to Assistants API
- OpenAI held their first Dev Day on November 6th, 2023, where they made several product announcements.
- One of the key announcements was the introduction of the Assistants API, which simplifies the process of building chat-based applications.
- In this blog post, we will focus on the Assistants API and compare it to the previously used Chat API in the Android JetchatAI sample app.
Key Features of Assistants API
- Stateful: The history of the conversation is stored on the server, making it easier for the client app to track the thread identifier and send new messages.
- Sliding window: The API automatically manages the context window of the model, reducing the need for manual management.
- Code interpreter: The API allows for the generation and execution of Python code to answer questions, making it more versatile and powerful.
Implementing an Assistant with the Assistants API
- The Assistants overview provides a detailed guide on how to implement an Assistant using the API in Python.
- The blog post showcases an example of an Assistant prototype built in the Playground that can answer questions based on documentation sources.
- The prototype demonstrates how the Assistant can provide responses grounded in uploaded documents, with relevant citations.
Comparison to Chat API
- The Assistants API simplifies the process of building chat-based applications compared to the previously used Chat API.
- With the Assistants API, the client code only needs to keep track of the thread identifier and exchange queries and responses with the server.
- Tasks such as managing the conversation history, context window, chunking source data, and prompt tweaking are handled by the API.
Future with Kotlin
- While the Assistants API is still in beta, it is expected that the implementation of Assistants in Kotlin will be much simpler compared to the Chat API.
- Instead of complex code for conversation management, the Kotlin code will focus on exchanging queries and responses with the server.
- The OpenAI Kotlin open-source client library is currently implementing the Assistants API, with progress visible in a pull request.
Resources and Feedback
- More details on the OpenAI Dev Day announcements can be found on the OpenAI blog.
- The Assistants API documentation provides in-depth technical details on how to use the API.
- The blog post encourages readers to provide feedback and share any tips or tricks they have learned from working with ChatGPT prompts.