|
11320 | 11320 | ], |
11321 | 11321 | "description": "The type of tool. \"dtmf\" for DTMF tool." |
11322 | 11322 | }, |
| 11323 | + "sipInfoDtmfEnabled": { |
| 11324 | + "type": "boolean", |
| 11325 | + "description": "This enables sending DTMF tones via SIP INFO messages instead of RFC 2833 (RTP events). When enabled, DTMF digits will be sent using the SIP INFO method, which can be more reliable in some network configurations. Only relevant when using the `vapi.sip` transport.", |
| 11326 | + "default": false |
| 11327 | + }, |
11323 | 11328 | "rejectionPlan": { |
11324 | 11329 | "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", |
11325 | 11330 | "allOf": [ |
|
37973 | 37978 | ], |
37974 | 37979 | "description": "The type of tool. \"dtmf\" for DTMF tool." |
37975 | 37980 | }, |
| 37981 | + "sipInfoDtmfEnabled": { |
| 37982 | + "type": "boolean", |
| 37983 | + "description": "This enables sending DTMF tones via SIP INFO messages instead of RFC 2833 (RTP events). When enabled, DTMF digits will be sent using the SIP INFO method, which can be more reliable in some network configurations. Only relevant when using the `vapi.sip` transport.", |
| 37984 | + "default": false |
| 37985 | + }, |
37976 | 37986 | "id": { |
37977 | 37987 | "type": "string", |
37978 | 37988 | "description": "This is the unique identifier for the tool." |
|
40414 | 40424 | ] |
40415 | 40425 | } |
40416 | 40426 | }, |
| 40427 | + "sipInfoDtmfEnabled": { |
| 40428 | + "type": "boolean", |
| 40429 | + "description": "This enables sending DTMF tones via SIP INFO messages instead of RFC 2833 (RTP events). When enabled, DTMF digits will be sent using the SIP INFO method, which can be more reliable in some network configurations. Only relevant when using the `vapi.sip` transport.", |
| 40430 | + "default": false |
| 40431 | + }, |
40417 | 40432 | "rejectionPlan": { |
40418 | 40433 | "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", |
40419 | 40434 | "allOf": [ |
|
59740 | 59755 | "type" |
59741 | 59756 | ] |
59742 | 59757 | }, |
| 59758 | + "ClientInboundMessageSendTransportMessage": { |
| 59759 | + "type": "object", |
| 59760 | + "properties": { |
| 59761 | + "type": { |
| 59762 | + "type": "string", |
| 59763 | + "description": "This is the type of the message. Send \"send-transport-message\" to send a transport-specific message during the call.", |
| 59764 | + "enum": [ |
| 59765 | + "send-transport-message" |
| 59766 | + ] |
| 59767 | + }, |
| 59768 | + "message": { |
| 59769 | + "description": "This is the transport-specific message to send.", |
| 59770 | + "oneOf": [ |
| 59771 | + { |
| 59772 | + "$ref": "#/components/schemas/VapiSipTransportMessage", |
| 59773 | + "title": "VapiSipTransportMessage" |
| 59774 | + }, |
| 59775 | + { |
| 59776 | + "$ref": "#/components/schemas/TwilioTransportMessage", |
| 59777 | + "title": "TwilioTransportMessage" |
| 59778 | + } |
| 59779 | + ] |
| 59780 | + } |
| 59781 | + }, |
| 59782 | + "required": [ |
| 59783 | + "type", |
| 59784 | + "message" |
| 59785 | + ] |
| 59786 | + }, |
59743 | 59787 | "ClientInboundMessage": { |
59744 | 59788 | "type": "object", |
59745 | 59789 | "properties": { |
|
59765 | 59809 | { |
59766 | 59810 | "$ref": "#/components/schemas/ClientInboundMessageTransfer", |
59767 | 59811 | "title": "Transfer" |
| 59812 | + }, |
| 59813 | + { |
| 59814 | + "$ref": "#/components/schemas/ClientInboundMessageSendTransportMessage", |
| 59815 | + "title": "SendTransportMessage" |
59768 | 59816 | } |
59769 | 59817 | ] |
59770 | 59818 | } |
|
60968 | 61016 | "type", |
60969 | 61017 | "toolCall" |
60970 | 61018 | ] |
| 61019 | + }, |
| 61020 | + "VapiSipTransportMessage": { |
| 61021 | + "type": "object", |
| 61022 | + "properties": { |
| 61023 | + "transport": { |
| 61024 | + "type": "string", |
| 61025 | + "description": "This is the transport type.", |
| 61026 | + "enum": [ |
| 61027 | + "vapi.sip" |
| 61028 | + ] |
| 61029 | + }, |
| 61030 | + "sipVerb": { |
| 61031 | + "type": "string", |
| 61032 | + "description": "This is the SIP verb to use. Must be one of INFO, MESSAGE, or NOTIFY.", |
| 61033 | + "enum": [ |
| 61034 | + "INFO", |
| 61035 | + "MESSAGE", |
| 61036 | + "NOTIFY" |
| 61037 | + ] |
| 61038 | + }, |
| 61039 | + "headers": { |
| 61040 | + "type": "object", |
| 61041 | + "description": "These are the headers to include with the SIP request." |
| 61042 | + }, |
| 61043 | + "body": { |
| 61044 | + "type": "string", |
| 61045 | + "description": "This is the body of the SIP request, if any." |
| 61046 | + } |
| 61047 | + }, |
| 61048 | + "required": [ |
| 61049 | + "transport", |
| 61050 | + "sipVerb" |
| 61051 | + ] |
| 61052 | + }, |
| 61053 | + "TwilioTransportMessage": { |
| 61054 | + "type": "object", |
| 61055 | + "properties": { |
| 61056 | + "transport": { |
| 61057 | + "type": "string", |
| 61058 | + "description": "This is the transport type.", |
| 61059 | + "enum": [ |
| 61060 | + "twilio" |
| 61061 | + ] |
| 61062 | + }, |
| 61063 | + "twiml": { |
| 61064 | + "type": "string", |
| 61065 | + "description": "This is the TwiML to send to the Twilio call." |
| 61066 | + } |
| 61067 | + }, |
| 61068 | + "required": [ |
| 61069 | + "transport", |
| 61070 | + "twiml" |
| 61071 | + ] |
60971 | 61072 | } |
60972 | 61073 | } |
60973 | 61074 | } |
|
0 commit comments