{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "#/components/schemas/UpdateComputerToolDTO",
"title": "UpdateComputerToolDTO",
"type": "object",
"properties": {
"messages": {
"type": "array",
"description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/ToolMessageStart",
"title": "ToolMessageStart"
},
{
"$ref": "#/components/schemas/ToolMessageComplete",
"title": "ToolMessageComplete"
},
{
"$ref": "#/components/schemas/ToolMessageFailed",
"title": "ToolMessageFailed"
},
{
"$ref": "#/components/schemas/ToolMessageDelayed",
"title": "ToolMessageDelayed"
}
]
}
},
"subType": {
"type": "string",
"enum": [
"computer_20241022"
],
"description": "The sub type of tool."
},
"server": {
"description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.",
"allOf": [
{
"$ref": "#/components/schemas/Server"
}
]
},
"rejectionPlan": {
"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```",
"allOf": [
{
"$ref": "#/components/schemas/ToolRejectionPlan"
}
]
},
"name": {
"type": "string",
"description": "The name of the tool, fixed to 'computer'",
"default": "computer",
"enum": [
"computer"
]
},
"displayWidthPx": {
"type": "number",
"description": "The display width in pixels"
},
"displayHeightPx": {
"type": "number",
"description": "The display height in pixels"
},
"displayNumber": {
"type": "number",
"description": "Optional display number"
}
}
}