Certainty of "role" value / Is there a definitive ...
# support
g
When looking at all the different types of messages,
userMessage
,
ToolCallMessage
etc, Is there a definitive list of what values might be included within the
role
field for each one? https://docs.vapi.ai/api-reference/calls/get#response.body.messages.UserMessage
This page here: https://docs.vapi.ai/assistants/background-messages says role: “system” Designates the message origin as ‘system’, ensuring the addition is unobtrusive. Other possible values of role are ‘user’ | ‘assistant’ | ‘tool’ | ‘function’ However I'm seeing
tool_calls
show up as a role, as well as
bot
and
tool_call_result
c
Hey gravitygod, I sincerely apologize for the delay in our responses this week. We experimented with some process adjustments that didn’t work as intended, and unfortunately, this caused some disruptions. That’s entirely my responsibility. Just a quick note—our team is unavailable on weekends. However, if something urgent or critical comes up, feel free to reach out to me directly, and I’ll assist you. The support issues will be resolved in the coming weeks, and starting Monday, you can expect more consistent and improved support. Thank you so much for your patience and for continuing to stick with us!
Hi gravitygod, You can refer to the [May 26, 2025 Changelog](https://docs.vapi.ai/changelog/2025/5/26) for information on the default roles in message schemas. The
role
property has default values for the message types as follows: - **ToolMessage**: "tool" - **AssistantMessage**: "assistant" - **DeveloperMessage**: "developer" These default values simplify message construction by allowing you to omit the role field. If you need more details about roles per message type, check the specific schema definitions the [Client Message documentation](https://docs.vapi.ai/api-reference/webhooks/client-message).
g
Thanks @User , But I'm also seeing the following values come through under
role
in artifact.messages:
bot
tool_call_result
tool_calls
assistant
user
system
I'm trying to build my own ENUM, but can't see where these roles are listed?
c
Hi, First off, we want to sincerely apologize for the delay in getting back to you. We understand how frustrating it is to wait - especially when you're counting on us - and we owe you a clear explanation of what’s been happening and how we’re addressing it. Over the past few weeks, we've seen a significant increase in support requests. While this reflects exciting growth, it has also stretched our small team and exposed some real challenges in scaling our support operations. To improve your experience, we’ve taken a step back to reassess our approach. Here’s what we’re implementing: - Smarter Support Through Automation: We’re investing in our AI support systems to help you resolve issues more efficiently. Soon, our support bot will offer expanded capabilities, making it easier to access accurate, instant help—particularly for common or repetitive queries. - Expanding the Support Team: To meet growing demand, we’re adding 2–3 new team members focused on managing support volume and improving response times. - Prioritized SLAs for High-Usage Accounts: We’re introducing service level improvements for users who are growing with us: - Accounts with usage over 1,000 minutes/month will receive prioritized support. - For all general inquiries, we’re establishing a standardized 48-hour response time. We’re confident these steps will lead to faster, more reliable support and help us better serve you as you grow with us. Also, in case you still need help with this ongoing ticket, do let us know, and we will help you get this resolved as soon as possible. Thank you for your continued patience and for being part of our journey. Warm regards, Vapi Team
g
Thanks @Shubham Bajaj / @Vapi @User Are you able to take a look at the question above when you can?
c
I have gathered a list of the enums you listed above and their relevancy to the platform: 1. 'user' - Messages from the user (lines 5-42) 2. 'bot' - Messages from the AI assistant (lines 44-88) 3. 'system' - System messages/instructions (lines 90-114) 4. 'tool_calls' - When the assistant makes tool calls (lines 196-226) 5. 'tool_call_result' - Results from tool calls (lines 228-271) 6. 'assistant' - This appears in some contexts as an alias for 'bot' (I found code that converts assistant → bot) 7. 'function_call' - Deprecated, replaced by tool_calls 8. 'function_result' - Deprecated, replaced by tool_call_result For OpenAI messages, these roles are defined as follows:
Copy code
const ROLE = {
  SYSTEM: 'system',
  USER: 'user',
  ASSISTANT: 'assistant',
  TOOL: 'tool',
  DEVELOPER: 'developer',
} as const;
If you have additional questions about the roles, feel free to put them here
g
Thank you so much Kyle!
c
No worries. Glad I could help :)
g
Might be helpful to have a reference as part of the docs that acts as a source of truth for this one 🙂
5 Views