Assistants API
The Assistants API (introduced by Open AI in late 2023) allows you to build AI agents with minimal code on OpenAI’s chat completion models. This is an API that will soon be integrated into Semantic Kernel to build agent-like experiences, as mentioned in a blog by Microsoft (https://devblogs. microsoft.com/semantic-kernel/assistants-the-future-of-semantic-kernel/).
This API helps developers build high-quality copilot -like experiences in their own applications. As discussed earlier, copilots are AI assistants integrated into applications to help address questions or provide instructional steps to help the user achieve more complex tasks.
Before, creating custom AI assistants required a lot of work, even for skilled developers. The chat completions API from OpenAI is easy to use and powerful, but it is not stateful (does not have state), which meant developers and/or operations had to manage conversation state and chat threads, tool integrations, the retrieval of documents, and also managing indexes, all while running code manually. In OpenAI’s evolution, the Assistants API is the stateful version of the chat completion API, and it offers a solution to address these problems.
It is now easier than ever to build customizable, specific generative AI applications and services that can search through data, propose solutions, and automate tasks. Assistants API supports persistent and unlimited (infinitely long) threads. This means that you do not need to create a thread state management system or deal with a model’s context window limitations as developers. You can just add new messages to a thread, and users reply (prompt/completions). The Assistants API can also access files in different formats, either when creating an assistant or as part of threads. Assistants can also access multiple tools as needed. Some example tools include the following:
- Function calling: The Assistants API can call an existing function or code subroutine. With the Assistants API, your assistant can learn what your app or external APIs do, choose the right time to call those functions, and use the function(s) in response to messages or other behavior.
- Code interpreter: With the code interpreter tool from OpenAI/Azure OpenAI Service, you can write and execute code, such as Python code, in a separate environment. You can use it for various purposes, such as finding solutions to difficult code and math problems step by step, doing advanced data analysis on user-added files in different formats, and creating data visualization such as reports, charts, and graphs. The Assistants API can integrate and run code interpreters as they may deem necessary or as directed.
Leave a Reply