diff --git a/fern/apis/api/openapi.json b/fern/apis/api/openapi.json index 55b794f63..2470cf2ac 100644 --- a/fern/apis/api/openapi.json +++ b/fern/apis/api/openapi.json @@ -911,7 +911,8 @@ "eq": "2", "gt": "1" } - } + }, + "type": "object" } }, { @@ -4346,367 +4347,45 @@ ] } }, - "/eval": { + "/structured-output/run": { "post": { - "operationId": "EvalController_create", - "summary": "Create Eval", + "operationId": "StructuredOutputController_run", + "summary": "Run Structured Output", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateEvalDTO" - } - } - } - }, - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Eval" - } - } - } - } - }, - "tags": [ - "Eval" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "get": { - "operationId": "EvalController_getPaginated", - "summary": "List Evals", - "parameters": [ - { - "name": "id", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "page", - "required": false, - "in": "query", - "description": "This is the page number to return. Defaults to 1.", - "schema": { - "minimum": 1, - "type": "number" - } - }, - { - "name": "sortOrder", - "required": false, - "in": "query", - "description": "This is the sort order for pagination. Defaults to 'DESC'.", - "schema": { - "enum": [ - "ASC", - "DESC" - ], - "type": "string" - } - }, - { - "name": "limit", - "required": false, - "in": "query", - "description": "This is the maximum number of items to return. Defaults to 100.", - "schema": { - "minimum": 0, - "maximum": 1000, - "type": "number" - } - }, - { - "name": "createdAtGt", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is greater than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdAtLt", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is less than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdAtGe", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is greater than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdAtLe", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is less than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtGt", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is greater than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtLt", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is less than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtGe", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is greater than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtLe", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is less than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvalPaginatedResponse" - } - } - } - } - }, - "tags": [ - "Eval" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/eval/{id}": { - "patch": { - "operationId": "EvalController_update", - "summary": "Update Eval", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateEvalDTO" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Eval" - } - } - } - } - }, - "tags": [ - "Eval" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "delete": { - "operationId": "EvalController_remove", - "summary": "Delete Eval", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Eval" - } - } - } - } - }, - "tags": [ - "Eval" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "get": { - "operationId": "EvalController_get", - "summary": "Get Eval", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Eval" - } + "$ref": "#/components/schemas/StructuredOutputRunDTO" } } } }, - "tags": [ - "Eval" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/eval/run/{id}": { - "delete": { - "operationId": "EvalController_removeRun", - "summary": "Delete Eval Run", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvalRun" + "$ref": "#/components/schemas/StructuredOutput" } } } - } - }, - "tags": [ - "Eval" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "get": { - "operationId": "EvalController_getRun", - "summary": "Get Eval Run", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { + }, + "201": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvalRun" + "type": "object" } } } } }, "tags": [ - "Eval" + "Structured Outputs" ], "security": [ { @@ -4715,31 +4394,28 @@ ] } }, - "/eval/run": { + "/eval": { "post": { - "operationId": "EvalController_run", - "summary": "Create Eval Run", + "operationId": "EvalController_create", + "summary": "Create Eval", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateEvalRunDTO" + "$ref": "#/components/schemas/CreateEvalDTO" } } } }, "responses": { - "200": { - "description": "" - }, "201": { "description": "", "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/Eval" } } } @@ -4755,8 +4431,380 @@ ] }, "get": { - "operationId": "EvalController_getRunsPaginated", - "summary": "List Eval Runs", + "operationId": "EvalController_getPaginated", + "summary": "List Evals", + "parameters": [ + { + "name": "id", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "This is the page number to return. Defaults to 1.", + "schema": { + "minimum": 1, + "type": "number" + } + }, + { + "name": "sortOrder", + "required": false, + "in": "query", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "schema": { + "enum": [ + "ASC", + "DESC" + ], + "type": "string" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "This is the maximum number of items to return. Defaults to 100.", + "schema": { + "minimum": 0, + "maximum": 1000, + "type": "number" + } + }, + { + "name": "createdAtGt", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is greater than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtLt", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is less than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtGe", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is greater than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtLe", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is less than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtGt", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is greater than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtLt", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is less than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtGe", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is greater than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtLe", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is less than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvalPaginatedResponse" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/eval/{id}": { + "patch": { + "operationId": "EvalController_update", + "summary": "Update Eval", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateEvalDTO" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eval" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "delete": { + "operationId": "EvalController_remove", + "summary": "Delete Eval", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eval" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "get": { + "operationId": "EvalController_get", + "summary": "Get Eval", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eval" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/eval/run/{id}": { + "delete": { + "operationId": "EvalController_removeRun", + "summary": "Delete Eval Run", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvalRun" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "get": { + "operationId": "EvalController_getRun", + "summary": "Get Eval Run", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvalRun" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/eval/run": { + "post": { + "operationId": "EvalController_run", + "summary": "Create Eval Run", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEvalRunDTO" + } + } + } + }, + "responses": { + "200": { + "description": "" + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "get": { + "operationId": "EvalController_getRunsPaginated", + "summary": "List Eval Runs", "parameters": [ { "name": "id", @@ -15094,6 +15142,504 @@ "provider" ] }, + "TransferHookAction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of action - must be \"transfer\"", + "enum": [ + "transfer" + ] + }, + "destination": { + "description": "This is the destination details for the transfer - can be a phone number or SIP URI", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] + } + }, + "required": [ + "type" + ] + }, + "FunctionCallHookAction": { + "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" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of tool. \"function\" for Function tool." + }, + "async": { + "type": "boolean", + "example": false, + "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." + }, + "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" + } + ] + }, + "function": { + "description": "This is the function definition of the tool.", + "allOf": [ + { + "$ref": "#/components/schemas/OpenAIFunction" + } + ] + } + }, + "required": [ + "type" + ] + }, + "SayHookAction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of action - must be \"say\"", + "enum": [ + "say" + ] + }, + "prompt": { + "description": "This is the prompt for the assistant to generate a response based on existing conversation.\nCan be a string or an array of chat messages.", + "oneOf": [ + { + "type": "string", + "title": "String" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + }, + "title": "MessageArray" + } + ], + "examples": [ + "Ask the user if they're still in the call", + [ + { + "role": "system", + "content": "You are a helpful assistant, and would like to know if the user is still in the call based on the conversation history in {{transcript}}" + } + ] + ] + }, + "exact": { + "type": "object", + "description": "This is the message to say" + } + }, + "required": [ + "type" + ] + }, + "CallHookFilter": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of filter - currently only \"oneOf\" is supported", + "enum": [ + "oneOf" + ], + "maxLength": 1000 + }, + "key": { + "type": "string", + "description": "This is the key to filter on (e.g. \"call.endedReason\")", + "maxLength": 1000 + }, + "oneOf": { + "description": "This is the array of possible values to match against", + "type": "array", + "items": { + "type": "string", + "maxLength": 1000 + } + } + }, + "required": [ + "type", + "key", + "oneOf" + ] + }, + "CallHookCallEnding": { + "type": "object", + "properties": { + "on": { + "type": "string", + "description": "This is the event that triggers this hook", + "enum": [ + "call.ending" + ], + "maxLength": 1000 + }, + "do": { + "type": "array", + "description": "This is the set of actions to perform when the hook triggers", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" + } + ] + } + }, + "filters": { + "description": "This is the set of filters that must match for the hook to trigger", + "type": "array", + "items": { + "$ref": "#/components/schemas/CallHookFilter" + } + } + }, + "required": [ + "on", + "do" + ] + }, + "CallHookAssistantSpeechInterrupted": { + "type": "object", + "properties": { + "on": { + "type": "string", + "description": "This is the event that triggers this hook", + "enum": [ + "assistant.speech.interrupted" + ], + "maxLength": 1000 + }, + "do": { + "type": "array", + "description": "This is the set of actions to perform when the hook triggers", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SayHookAction", + "title": "SayHookAction" + }, + { + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" + } + ] + } + } + }, + "required": [ + "on", + "do" + ] + }, + "CallHookCustomerSpeechInterrupted": { + "type": "object", + "properties": { + "on": { + "type": "string", + "description": "This is the event that triggers this hook", + "enum": [ + "customer.speech.interrupted" + ], + "maxLength": 1000 + }, + "do": { + "type": "array", + "description": "This is the set of actions to perform when the hook triggers", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SayHookAction", + "title": "SayHookAction" + }, + { + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" + } + ] + } + } + }, + "required": [ + "on", + "do" + ] + }, + "ToolCallHookAction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of action - must be \"tool\"", + "enum": [ + "tool" + ] + }, + "tool": { + "description": "This is the tool to call. To use an existing tool, send `toolId` instead.", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateApiRequestToolDTO", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/CreateBashToolDTO", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/CreateComputerToolDTO", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/CreateDtmfToolDTO", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/CreateEndCallToolDTO", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/CreateFunctionToolDTO", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/CreateHandoffToolDTO", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/CreateMcpToolDTO", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/CreateQueryToolDTO", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/CreateSmsToolDTO", + "title": "SmsTool" + }, + { + "$ref": "#/components/schemas/CreateTextEditorToolDTO", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/CreateTransferCallToolDTO", + "title": "TransferCallTool" + } + ] + }, + "toolId": { + "type": "string", + "description": "This is the tool to call. To use a transient tool, send `tool` instead." + } + }, + "required": [ + "type" + ] + }, + "CustomerSpeechTimeoutOptions": { + "type": "object", + "properties": { + "timeoutSeconds": { + "type": "number", + "description": "This is the timeout in seconds before action is triggered.\nThe clock starts when the assistant finishes speaking and remains active until the user speaks.\n\n@default 7.5", + "minimum": 1, + "maximum": 1000 + }, + "triggerMaxCount": { + "type": "number", + "description": "This is the maximum number of times the hook will trigger in a call.\n\n@default 3", + "minimum": 1, + "maximum": 10 + }, + "triggerResetMode": { + "type": "object", + "description": "This is whether the counter for hook trigger resets the user speaks.\n\n@default never" + } + }, + "required": [ + "timeoutSeconds" + ] + }, + "CallHookCustomerSpeechTimeout": { + "type": "object", + "properties": { + "on": { + "type": "string", + "description": "Must be either \"customer.speech.timeout\" or match the pattern \"customer.speech.timeout[property=value]\"", + "maxLength": 1000 + }, + "do": { + "type": "array", + "description": "This is the set of actions to perform when the hook triggers", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SayHookAction", + "title": "SayHookAction" + }, + { + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" + } + ] + } + }, + "options": { + "description": "This is the set of filters that must match for the hook to trigger", + "allOf": [ + { + "$ref": "#/components/schemas/CustomerSpeechTimeoutOptions" + } + ] + }, + "name": { + "type": "string", + "description": "This is the name of the hook, it can be set by the user to identify the hook.\nIf no name is provided, the hook will be auto generated as UUID.\n\n@default UUID", + "maxLength": 1000 + } + }, + "required": [ + "on", + "do" + ] + }, + "CallHookModelResponseTimeout": { + "type": "object", + "properties": { + "on": { + "type": "string", + "description": "This is the event that triggers this hook", + "enum": [ + "model.response.timeout" + ], + "maxLength": 1000 + }, + "do": { + "type": "array", + "description": "This is the set of actions to perform when the hook triggers", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SayHookAction", + "title": "SayHookAction" + }, + { + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" + } + ] + } + } + }, + "required": [ + "on", + "do" + ] + }, "AIEdgeCondition": { "type": "object", "properties": { @@ -16453,6 +16999,10 @@ { "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", "title": "CallHookCustomerSpeechTimeout" + }, + { + "$ref": "#/components/schemas/CallHookModelResponseTimeout", + "title": "CallHookModelResponseTimeout" } ] } @@ -16724,6 +17274,12 @@ "voicemailDetection": { "description": "This is the voicemail detection plan for the workflow.", "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, { "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", "title": "Google" @@ -23248,471 +23804,6 @@ "groupId" ] }, - "TransferHookAction": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "This is the type of action - must be \"transfer\"", - "enum": [ - "transfer" - ] - }, - "destination": { - "description": "This is the destination details for the transfer - can be a phone number or SIP URI", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - } - }, - "required": [ - "type" - ] - }, - "FunctionCallHookAction": { - "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" - } - ] - } - }, - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "The type of tool. \"function\" for Function tool." - }, - "async": { - "type": "boolean", - "example": false, - "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." - }, - "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" - } - ] - }, - "function": { - "description": "This is the function definition of the tool.", - "allOf": [ - { - "$ref": "#/components/schemas/OpenAIFunction" - } - ] - } - }, - "required": [ - "type" - ] - }, - "SayHookAction": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "This is the type of action - must be \"say\"", - "enum": [ - "say" - ] - }, - "prompt": { - "description": "This is the prompt for the assistant to generate a response based on existing conversation.\nCan be a string or an array of chat messages.", - "oneOf": [ - { - "type": "string", - "title": "String" - }, - { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" - }, - { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" - } - ] - }, - "title": "MessageArray" - } - ], - "examples": [ - "Ask the user if they're still in the call", - [ - { - "role": "system", - "content": "You are a helpful assistant, and would like to know if the user is still in the call based on the conversation history in {{transcript}}" - } - ] - ] - }, - "exact": { - "type": "object", - "description": "This is the message to say" - } - }, - "required": [ - "type" - ] - }, - "CallHookFilter": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "This is the type of filter - currently only \"oneOf\" is supported", - "enum": [ - "oneOf" - ], - "maxLength": 1000 - }, - "key": { - "type": "string", - "description": "This is the key to filter on (e.g. \"call.endedReason\")", - "maxLength": 1000 - }, - "oneOf": { - "description": "This is the array of possible values to match against", - "type": "array", - "items": { - "type": "string", - "maxLength": 1000 - } - } - }, - "required": [ - "type", - "key", - "oneOf" - ] - }, - "CallHookCallEnding": { - "type": "object", - "properties": { - "on": { - "type": "string", - "description": "This is the event that triggers this hook", - "enum": [ - "call.ending" - ], - "maxLength": 1000 - }, - "do": { - "type": "array", - "description": "This is the set of actions to perform when the hook triggers", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolCallHookAction", - "title": "ToolCallHookAction" - } - ] - } - }, - "filters": { - "description": "This is the set of filters that must match for the hook to trigger", - "type": "array", - "items": { - "$ref": "#/components/schemas/CallHookFilter" - } - } - }, - "required": [ - "on", - "do" - ] - }, - "CallHookAssistantSpeechInterrupted": { - "type": "object", - "properties": { - "on": { - "type": "string", - "description": "This is the event that triggers this hook", - "enum": [ - "assistant.speech.interrupted" - ], - "maxLength": 1000 - }, - "do": { - "type": "array", - "description": "This is the set of actions to perform when the hook triggers", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SayHookAction", - "title": "SayHookAction" - }, - { - "$ref": "#/components/schemas/ToolCallHookAction", - "title": "ToolCallHookAction" - } - ] - } - } - }, - "required": [ - "on", - "do" - ] - }, - "CallHookCustomerSpeechInterrupted": { - "type": "object", - "properties": { - "on": { - "type": "string", - "description": "This is the event that triggers this hook", - "enum": [ - "customer.speech.interrupted" - ], - "maxLength": 1000 - }, - "do": { - "type": "array", - "description": "This is the set of actions to perform when the hook triggers", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SayHookAction", - "title": "SayHookAction" - }, - { - "$ref": "#/components/schemas/ToolCallHookAction", - "title": "ToolCallHookAction" - } - ] - } - } - }, - "required": [ - "on", - "do" - ] - }, - "ToolCallHookAction": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "This is the type of action - must be \"tool\"", - "enum": [ - "tool" - ] - }, - "tool": { - "description": "This is the tool to call. To use an existing tool, send `toolId` instead.", - "oneOf": [ - { - "$ref": "#/components/schemas/CreateApiRequestToolDTO", - "title": "ApiRequestTool" - }, - { - "$ref": "#/components/schemas/CreateBashToolDTO", - "title": "BashTool" - }, - { - "$ref": "#/components/schemas/CreateComputerToolDTO", - "title": "ComputerTool" - }, - { - "$ref": "#/components/schemas/CreateDtmfToolDTO", - "title": "DtmfTool" - }, - { - "$ref": "#/components/schemas/CreateEndCallToolDTO", - "title": "EndCallTool" - }, - { - "$ref": "#/components/schemas/CreateFunctionToolDTO", - "title": "FunctionTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", - "title": "GoHighLevelCalendarAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", - "title": "GoHighLevelCalendarEventCreateTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", - "title": "GoHighLevelContactCreateTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", - "title": "GoHighLevelContactGetTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", - "title": "GoogleCalendarCheckAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", - "title": "GoogleCalendarCreateEventTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", - "title": "GoogleSheetsRowAppendTool" - }, - { - "$ref": "#/components/schemas/CreateHandoffToolDTO", - "title": "HandoffTool" - }, - { - "$ref": "#/components/schemas/CreateMcpToolDTO", - "title": "McpTool" - }, - { - "$ref": "#/components/schemas/CreateQueryToolDTO", - "title": "QueryTool" - }, - { - "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", - "title": "SlackSendMessageTool" - }, - { - "$ref": "#/components/schemas/CreateSmsToolDTO", - "title": "SmsTool" - }, - { - "$ref": "#/components/schemas/CreateTextEditorToolDTO", - "title": "TextEditorTool" - }, - { - "$ref": "#/components/schemas/CreateTransferCallToolDTO", - "title": "TransferCallTool" - } - ] - }, - "toolId": { - "type": "string", - "description": "This is the tool to call. To use a transient tool, send `tool` instead." - } - }, - "required": [ - "type" - ] - }, - "CustomerSpeechTimeoutOptions": { - "type": "object", - "properties": { - "timeoutSeconds": { - "type": "number", - "description": "This is the timeout in seconds before action is triggered.\nThe clock starts when the assistant finishes speaking and remains active until the user speaks.\n\n@default 7.5", - "minimum": 1, - "maximum": 1000 - }, - "triggerMaxCount": { - "type": "number", - "description": "This is the maximum number of times the hook will trigger in a call.\n\n@default 3", - "minimum": 1, - "maximum": 10 - }, - "triggerResetMode": { - "type": "object", - "description": "This is whether the counter for hook trigger resets the user speaks.\n\n@default never" - } - }, - "required": [ - "timeoutSeconds" - ] - }, - "CallHookCustomerSpeechTimeout": { - "type": "object", - "properties": { - "on": { - "type": "string", - "description": "Must be either \"customer.speech.timeout\" or match the pattern \"customer.speech.timeout[property=value]\"", - "maxLength": 1000 - }, - "do": { - "type": "array", - "description": "This is the set of actions to perform when the hook triggers", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SayHookAction", - "title": "SayHookAction" - }, - { - "$ref": "#/components/schemas/ToolCallHookAction", - "title": "ToolCallHookAction" - } - ] - } - }, - "options": { - "description": "This is the set of filters that must match for the hook to trigger", - "allOf": [ - { - "$ref": "#/components/schemas/CustomerSpeechTimeoutOptions" - } - ] - }, - "name": { - "type": "string", - "description": "This is the name of the hook, it can be set by the user to identify the hook.\nIf no name is provided, the hook will be auto generated as UUID.\n\n@default UUID", - "maxLength": 1000 - } - }, - "required": [ - "on", - "do" - ] - }, "SQLInjectionSecurityFilter": { "type": "object", "properties": { @@ -24015,8 +24106,14 @@ "example": "assistant-speaks-first" }, "voicemailDetection": { - "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nThis uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached.\nYou can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.", + "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nBy default, voicemail detection is disabled.", "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, { "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", "title": "Google" @@ -24816,8 +24913,14 @@ "example": "assistant-speaks-first" }, "voicemailDetection": { - "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nThis uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached.\nYou can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.", + "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nBy default, voicemail detection is disabled.", "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, { "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", "title": "Google" @@ -25707,8 +25810,14 @@ "example": "assistant-speaks-first" }, "voicemailDetection": { - "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nThis uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached.\nYou can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.", + "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nBy default, voicemail detection is disabled.", "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, { "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", "title": "Google" @@ -26508,8 +26617,14 @@ "example": "assistant-speaks-first" }, "voicemailDetection": { - "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nThis uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached.\nYou can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.", + "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nBy default, voicemail detection is disabled.", "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, { "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", "title": "Google" @@ -27551,6 +27666,10 @@ { "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", "title": "CallHookCustomerSpeechTimeout" + }, + { + "$ref": "#/components/schemas/CallHookModelResponseTimeout", + "title": "CallHookModelResponseTimeout" } ] } @@ -27822,6 +27941,12 @@ "voicemailDetection": { "description": "This is the voicemail detection plan for the workflow.", "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, { "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", "title": "Google" @@ -28183,6 +28308,10 @@ { "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", "title": "CallHookCustomerSpeechTimeout" + }, + { + "$ref": "#/components/schemas/CallHookModelResponseTimeout", + "title": "CallHookModelResponseTimeout" } ] } @@ -28454,6 +28583,12 @@ "voicemailDetection": { "description": "This is the voicemail detection plan for the workflow.", "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, { "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", "title": "Google" @@ -28797,6 +28932,10 @@ { "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", "title": "CallHookCustomerSpeechTimeout" + }, + { + "$ref": "#/components/schemas/CallHookModelResponseTimeout", + "title": "CallHookModelResponseTimeout" } ] } @@ -29068,6 +29207,12 @@ "voicemailDetection": { "description": "This is the voicemail detection plan for the workflow.", "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, { "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", "title": "Google" @@ -29583,6 +29728,11 @@ "items": { "type": "string" } + }, + "structuredOutputsLastUpdatedAt": { + "format": "date-time", + "type": "string", + "description": "This is when the structured outputs were last updated" } } }, @@ -30554,8 +30704,6 @@ "call.in-progress.error-warm-transfer-assistant-cancelled", "call.in-progress.error-warm-transfer-silence-timeout", "call.in-progress.error-warm-transfer-microphone-timeout", - "call.in-progress.error-warm-transfer-hang-timeout", - "call.in-progress.error-warm-transfer-idle-timeout", "assistant-ended-call", "assistant-said-end-call-phrase", "assistant-ended-call-with-hangup-task", @@ -31066,6 +31214,10 @@ "CreateWebCallDTO": { "type": "object", "properties": { + "roomDeleteOnUserLeaveEnabled": { + "type": "boolean", + "default": true + }, "assistantId": { "type": "string", "description": "This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead.\n\nTo start a call with:\n- Assistant, use `assistantId` or `assistant`\n- Squad, use `squadId` or `squad`\n- Workflow, use `workflowId` or `workflow`" @@ -32757,6 +32909,30 @@ "type": "string", "description": "This is the ISO 8601 timestamp indicating when the session was last updated." }, + "cost": { + "type": "number", + "description": "This is the cost of the session in USD." + }, + "costs": { + "type": "array", + "description": "These are the costs of individual components of the session in USD.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ModelCost", + "title": "ModelCost" + }, + { + "$ref": "#/components/schemas/AnalysisCost", + "title": "AnalysisCost" + }, + { + "$ref": "#/components/schemas/SessionCost", + "title": "SessionCost" + } + ] + } + }, "name": { "type": "string", "description": "This is a user-defined name for the session. Maximum length is 40 characters.", @@ -38579,6 +38755,38 @@ } } }, + "StructuredOutputRunDTO": { + "type": "object", + "properties": { + "preview": { + "type": "boolean", + "description": "This is the preview flag for the re-run. If true, the re-run will be executed and the response will be returned immediately and the call artifact will NOT be updated.\nIf false (default), the re-run will be executed and the response will be updated in the call artifact.", + "default": false + }, + "structuredOutputId": { + "type": "string", + "description": "This is the ID of the structured output that will be run. This must be provided unless a transient structured output is provided.\nWhen the re-run is executed, only the value of this structured output will be replaced with the new value, or added if not present." + }, + "structuredOutput": { + "description": "This is the transient structured output that will be run. This must be provided if a structured output ID is not provided.\nWhen the re-run is executed, the structured output value will be added to the existing artifact.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateStructuredOutputDTO" + } + ] + }, + "callIds": { + "description": "This is the array of callIds that will be updated with the new structured output value. If preview is true, this array must be provided and contain exactly 1 callId.\nIf preview is false, up to 100 callIds may be provided.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "callIds" + ] + }, "TesterPlan": { "type": "object", "properties": { @@ -39938,11 +40146,20 @@ "description": "This is the max tokens of the model.\nIf your Judge instructions return `true` or `false` takes only 1 token (as per the OpenAI Tokenizer), and therefore is recommended to set it to a low number to force the model to return a short response.", "minimum": 50, "maximum": 10000 + }, + "messages": { + "description": "These are the messages which will instruct the AI Judge on how to evaluate the assistant message.\nThe LLM-Judge must respond with \"pass\" or \"fail\" to indicate if the assistant message passes the eval.\n\nTo access the messages in the mock conversation, use the LiquidJS variable `{{messages}}`.\nThe assistant message to be evaluated will be passed as the last message in the `messages` array and can be accessed using `{{messages[-1]}}`.\n\nIt is recommended to use the system message to instruct the LLM how to evaluate the assistant message, and then use the first user message to pass the assistant message to be evaluated.", + "example": "{", + "type": "array", + "items": { + "type": "object" + } } }, "required": [ "provider", - "model" + "model", + "messages" ] }, "EvalAnthropicModel": { @@ -39992,11 +40209,20 @@ "description": "This is the max tokens of the model.\nIf your Judge instructions return `true` or `false` takes only 1 token (as per the OpenAI Tokenizer), and therefore is recommended to set it to a low number to force the model to return a short response.", "minimum": 50, "maximum": 10000 + }, + "messages": { + "description": "These are the messages which will instruct the AI Judge on how to evaluate the assistant message.\nThe LLM-Judge must respond with \"pass\" or \"fail\" to indicate if the assistant message passes the eval.\n\nTo access the messages in the mock conversation, use the LiquidJS variable `{{messages}}`.\nThe assistant message to be evaluated will be passed as the last message in the `messages` array and can be accessed using `{{messages[-1]}}`.\n\nIt is recommended to use the system message to instruct the LLM how to evaluate the assistant message, and then use the first user message to pass the assistant message to be evaluated.", + "example": "{", + "type": "array", + "items": { + "type": "object" + } } }, "required": [ "provider", - "model" + "model", + "messages" ] }, "EvalGoogleModel": { @@ -40041,11 +40267,20 @@ "description": "This is the max tokens of the model.\nIf your Judge instructions return `true` or `false` takes only 1 token (as per the OpenAI Tokenizer), and therefore is recommended to set it to a low number to force the model to return a short response.", "minimum": 50, "maximum": 10000 + }, + "messages": { + "description": "These are the messages which will instruct the AI Judge on how to evaluate the assistant message.\nThe LLM-Judge must respond with \"pass\" or \"fail\" to indicate if the assistant message passes the eval.\n\nTo access the messages in the mock conversation, use the LiquidJS variable `{{messages}}`.\nThe assistant message to be evaluated will be passed as the last message in the `messages` array and can be accessed using `{{messages[-1]}}`.\n\nIt is recommended to use the system message to instruct the LLM how to evaluate the assistant message, and then use the first user message to pass the assistant message to be evaluated.", + "example": "{", + "type": "array", + "items": { + "type": "object" + } } }, "required": [ "provider", - "model" + "model", + "messages" ] }, "EvalGroqModel": { @@ -40091,11 +40326,20 @@ "description": "This is the max tokens of the model.\nIf your Judge instructions return `true` or `false` takes only 1 token (as per the OpenAI Tokenizer), and therefore is recommended to set it to a low number to force the model to return a short response.", "minimum": 50, "maximum": 10000 + }, + "messages": { + "description": "These are the messages which will instruct the AI Judge on how to evaluate the assistant message.\nThe LLM-Judge must respond with \"pass\" or \"fail\" to indicate if the assistant message passes the eval.\n\nTo access the messages in the mock conversation, use the LiquidJS variable `{{messages}}`.\nThe assistant message to be evaluated will be passed as the last message in the `messages` array and can be accessed using `{{messages[-1]}}`.\n\nIt is recommended to use the system message to instruct the LLM how to evaluate the assistant message, and then use the first user message to pass the assistant message to be evaluated.", + "example": "{", + "type": "array", + "items": { + "type": "object" + } } }, "required": [ "provider", - "model" + "model", + "messages" ] }, "EvalCustomModel": { @@ -40138,12 +40382,21 @@ "description": "This is the max tokens of the model.\nIf your Judge instructions return `true` or `false` takes only 1 token (as per the OpenAI Tokenizer), and therefore is recommended to set it to a low number to force the model to return a short response.", "minimum": 50, "maximum": 10000 + }, + "messages": { + "description": "These are the messages which will instruct the AI Judge on how to evaluate the assistant message.\nThe LLM-Judge must respond with \"pass\" or \"fail\" to indicate if the assistant message passes the eval.\n\nTo access the messages in the mock conversation, use the LiquidJS variable `{{messages}}`.\nThe assistant message to be evaluated will be passed as the last message in the `messages` array and can be accessed using `{{messages[-1]}}`.\n\nIt is recommended to use the system message to instruct the LLM how to evaluate the assistant message, and then use the first user message to pass the assistant message to be evaluated.", + "example": "{", + "type": "array", + "items": { + "type": "object" + } } }, "required": [ "provider", "url", - "model" + "model", + "messages" ] }, "AssistantMessageJudgePlanAI": { @@ -40541,6 +40794,19 @@ "$ref": "#/components/schemas/EvalRunResult" } }, + "cost": { + "type": "number", + "description": "This is the cost of the eval or suite run in USD.", + "example": 0.01 + }, + "costs": { + "description": "This is the break up of costs of the eval or suite run.", + "example": "[{ type: \"model\", model: \"gpt-4o\", cost: 0.01 }]", + "type": "array", + "items": { + "type": "object" + } + }, "type": { "type": "string", "description": "This is the type of the run.\nCurrently it is fixed to `eval`.", @@ -40565,6 +40831,8 @@ "startedAt", "endedAt", "results", + "cost", + "costs", "type" ] }, @@ -49614,8 +49882,6 @@ "call.in-progress.error-warm-transfer-assistant-cancelled", "call.in-progress.error-warm-transfer-silence-timeout", "call.in-progress.error-warm-transfer-microphone-timeout", - "call.in-progress.error-warm-transfer-hang-timeout", - "call.in-progress.error-warm-transfer-idle-timeout", "assistant-ended-call", "assistant-said-end-call-phrase", "assistant-ended-call-with-hangup-task", @@ -50912,8 +51178,6 @@ "call.in-progress.error-warm-transfer-assistant-cancelled", "call.in-progress.error-warm-transfer-silence-timeout", "call.in-progress.error-warm-transfer-microphone-timeout", - "call.in-progress.error-warm-transfer-hang-timeout", - "call.in-progress.error-warm-transfer-idle-timeout", "assistant-ended-call", "assistant-said-end-call-phrase", "assistant-ended-call-with-hangup-task", @@ -53646,6 +53910,26 @@ "cost" ] }, + "SessionCost": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of cost, always 'session' for this class.", + "enum": [ + "session" + ] + }, + "cost": { + "type": "number", + "description": "This is the cost of the component in USD." + } + }, + "required": [ + "type", + "cost" + ] + }, "FunctionToolWithToolCall": { "type": "object", "properties": {