Introduction
This article offers an in-depth guide to the Azure OpenAI Assistant API, detailing its components, regional availability, supported API versions, compatible file types, and available tools including the Code Interpreter, function calling, and file searching.
Azure OpenAI Assistant API
Azure OpenAI Assistants (Preview) empowers you to build customized AI assistants by providing custom instructions and enhancing them with advanced features such as a code interpreter, custom functions, function calling, and file searching.
Components of assistants
- Assistant: A customized AI that leverages Azure OpenAI models alongside various tools.
- Thread: A conversation session between an Assistant and a user. Threads store Messages and automatically handle truncation to fit content into a model’s context.
- Message: A communication created by an Assistant or a user. Messages can include text, images, and other files. They are stored as a list within the Thread.
- Run: The activation of an Assistant to begin executing tasks based on the contents of the Thread. The Assistant uses its configuration and the Thread’s Messages to perform actions by calling models and tools. As part of a Run, the Assistant appends Messages to the Thread.
- Run Step: A detailed record of the steps the Assistant took during a Run. It includes calls to tools or the creation of Messages. Examining Run Steps lets you understand how the Assistant arrives at its final results.
Regions and Models support
The code interpreter is accessible in all regions supported by Azure OpenAI Assistants. For the latest details on regions and models where Assistants are available, refer to the models page.
Regions |
gpt-35-turbo (0613) |
gpt-35-turbo (1106) |
fine tuned gpt-3.5-turbo-0125 |
gpt-4 (0613) |
gpt-4 (1106) |
gpt-4 (0125) |
Australia East |
|
|
|
|
|
|
East US |
|
|
|
|
|
|
East US 2 |
|
|
|
|
|
|
France Central |
|
|
|
|
|
|
Japan East |
|
|
|
|
|
|
Norway East |
|
|
|
|
|
|
Sweden Central |
|
|
|
|
|
|
UK South |
|
|
|
|
|
|
West US |
|
|
|
|
|
|
West US 3 |
|
|
|
|
|
|
API versions
Currently, there are two API versions supported by the Azure OpenAI Assistants API are
- 2024-02-15-preview
- 2024-05-01-preview
Supported file formats
The following table lists the file formats supported by the Azure OpenAI Assistant API.
File format |
MIME Type |
Code Interpreter |
.c |
text/x-c |
|
.cpp |
text/x-c++ |
|
.csv |
application/CSV |
|
.docx |
application/vnd.openxmlformats-officedocument.wordprocessingml.document |
|
.html |
text/HTML |
|
.java |
text/x-java |
|
.json |
application/JSON |
|
.md |
text/markdown |
|
.pdf |
application/pdf |
|
.php |
text/x-php |
|
.pptx |
application/vnd.openxmlformats-officedocument.presentationml.presentation |
|
.py |
text/x-python |
|
.py |
text/x-script.python |
|
.rb |
text/x-ruby |
|
.tex |
text/x-tex |
|
.txt |
text/plain |
|
.css |
text/CSS |
|
.jpeg |
image/jpeg |
|
.jpg |
image/jpeg |
|
.js |
text/javascript |
|
.gif |
image/gif |
|
.png |
image/png |
|
.tar |
application/x-tar |
|
.ts |
application/typescript |
|
.xlsx |
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
|
.xml |
application/XML or "text/XML" |
|
.zip |
application/zip |
|
Tools used in the Azure OpenAI Assistant API
- Code interpreter: The Code Interpreter feature enables the Assistants API to write and execute Python code in a secure, sandboxed environment. With Code Interpreter activated, your Assistant can iteratively run code to tackle complex coding, math, and data analysis tasks. If the initial code execution fails, the Assistant can modify and rerun the code until it succeeds.
- Function calling: The Assistants API supports function calling, enabling you to define the structure of functions for an Assistant. The Assistant can then return the functions to be called along with their respective arguments.
- File search: File Search enhances the Assistant's capabilities by incorporating knowledge from external sources, such as proprietary product information or user-provided documents. OpenAI automatically processes and segments your documents, generates and stores embeddings, and employs both vector and keyword searches to retrieve relevant content for user queries.
Summary
In this article, we have gained insights into the purpose, features, and components of Assistants API. Specifically, we explored its tools like Code Interpreter, function calling and file search. Additionally, we delved into the language and regional support provided by this technology.
Happy Learning!
Hope you have enjoyed reading this article!