#What is an assistant in the API
1 messages · Page 1 of 1 (latest)
Hi @thick pollen. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
An Assistant in the context of the OpenAI API is a purpose-built AI that leverages OpenAI’s models and tools to perform tasks and respond to user queries. It is designed to be integrated within your own applications. An Assistant can access files, maintain persistent threads, and call tools. It operates based on the instructions embedded within the context window of the model.
The Assistants API currently supports three types of tools: Code Interpreter, File Search, and Function calling. The Code Interpreter tool allows the assistant to run code, the File Search tool enables the assistant to retrieve information from a file, and the Function calling tool allows the assistant to call third-party functions.
An Assistant is created by defining its custom instructions and picking a model. If helpful, files can be added and tools like Code Interpreter, File Search, and Function calling can be enabled. When a user starts a conversation, a Thread is created. Messages are added to the Thread as the user asks questions. The Assistant is then run on the Thread to generate a response by calling the model and the tools.
Here are some key objects related to an Assistant:
- Assistant: Purpose-built AI that uses OpenAI’s models and calls 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 message created by an Assistant or a user. Messages can include text, images, and other files. Messages are stored as a list on the Thread.
- Run: An invocation of an Assistant on a Thread. The Assistant uses its configuration and the Thread’s Messages to perform tasks by calling models and tools. As part of a Run, the Assistant appends Messages to the Thread.
- Run Step: A detailed list of steps the Assistant took as part of a Run. An Assistant can call tools or create Messages during its run. Examining Run Steps allows you to introspect how the Assistant is getting to its final results.
Sources:
- Assistants API (v2) FAQ (https://help.openai.com/en/articles/8550641-assistants-api-v2-faq)
- Introduction to Assistants (https://platform.openai.com/docs/introduction)
- How Assistants work (https://platform.openai.com/docs/assistants/how-it-works)
- GPTs vs Assistants (https://help.openai.com/en/articles/8673914-gpts-vs-assistants#h_5740051b75)
- Objects in Assistants (https://platform.openai.com/docs/assistants/how-it-works)
- Assistants API Overview (https://platform.openai.com/docs/assistants/overview)
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@thick pollen kapa.ai is still learning and improving, please let us know how it did by reacting below
so assistant user is just system user in other words? @carmine seal
@carmine seal so assistant user is just system user in other words?
Let me check the knowledge base for you. One moment! :books:
No, an "assistant" and a "system" user are not the same in the context of the OpenAI API. They have distinct roles in the conversation model.
The "assistant" role is used to store the responses of the AI model. These responses can be previous interactions or examples of desired behavior that you provide. The assistant's responses are used to guide the conversation and provide context for the AI model.
On the other hand, the "system" role is used to set the behavior of the assistant. System messages are not part of the conversation and are not accessible to the end-user. They are used to control the scope of the model’s interactions with the end-user. The model gives precedence to system messages over user messages, which means it adheres more strictly to the instructions given in the system role.
In a conversation, the order of roles typically starts with a "system" message, followed by alternating "user" and "assistant" messages. The "system" message sets the behavior of the assistant, the "user" message provides a request or comment, and the "assistant" message provides a response.
Sources:
- Purpose of the "system" role in OpenAI chat completions API (https://community.openai.com/t/497739)
- Role : assistant in client.chat.completions.create (https://community.openai.com/t/709144)
- Let llm modify you propmt (https://community.openai.com/t/617309)