diff --git a/fern/apis/api/openapi.json b/fern/apis/api/openapi.json index c2157684..1967070c 100644 --- a/fern/apis/api/openapi.json +++ b/fern/apis/api/openapi.json @@ -1200,6 +1200,15 @@ "type": "string" } }, + { + "name": "previousChatId", + "required": false, + "in": "query", + "description": "This is the unique identifier for the previous chat to filter by.", + "schema": { + "type": "string" + } + }, { "name": "page", "required": false, @@ -1911,6 +1920,89 @@ "type": "string" } }, + { + "required": false, + "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", + "name": "numberE164CheckEnabled", + "in": "query", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "required": false, + "description": "This is the extension that will be dialed after the call is answered.", + "name": "extension", + "in": "query", + "schema": { + "maxLength": 10, + "example": null, + "type": "string" + } + }, + { + "name": "assistantOverrides", + "required": false, + "description": "These are the overrides for the assistant's settings and template variables specific to this customer.\nThis allows customization of the assistant's behavior for individual customers in batch calls.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ], + "in": "query", + "schema": {} + }, + { + "required": false, + "description": "This is the number of the customer.", + "name": "number", + "in": "query", + "schema": { + "minLength": 3, + "maxLength": 40, + "type": "string" + } + }, + { + "required": false, + "description": "This is the SIP URI of the customer.", + "name": "sipUri", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "required": false, + "description": "This is the name of the customer. This is just for your own reference.\n\nFor SIP inbound calls, this is extracted from the `From` SIP header with format `\"Display Name\" `.", + "name": "name", + "in": "query", + "schema": { + "maxLength": 40, + "type": "string" + } + }, + { + "required": false, + "description": "This is the email of the customer.", + "name": "email", + "in": "query", + "schema": { + "maxLength": 40, + "type": "string" + } + }, + { + "required": false, + "description": "This is the external ID of the customer.", + "name": "externalId", + "in": "query", + "schema": { + "maxLength": 40, + "type": "string" + } + }, { "name": "page", "required": false, @@ -4386,6 +4478,50 @@ ] } }, + "/structured-output/suggest": { + "post": { + "operationId": "StructuredOutputController_suggest", + "summary": "Generate AI-Powered Structured Output Suggestions", + "description": "Analyzes assistant configuration and generates contextual structured output recommendations", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateStructuredOutputSuggestionsDTO" + } + } + } + }, + "responses": { + "200": { + "description": "Array of suggested structured outputs with relevance scores" + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Structured Outputs" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, "/reporting/insight": { "post": { "operationId": "InsightController_create", @@ -7908,6 +8044,17 @@ "maximum": 50, "default": 2 }, + "speakerLabels": { + "description": "Provides friendly speaker labels that map to diarization indices (Speaker 1 -> labels[0]).", + "example": [ + "Agent", + "Customer" + ], + "type": "array", + "items": { + "type": "string" + } + }, "enablePartials": { "type": "boolean", "description": "This enables partial transcripts during speech recognition. When false, only final transcripts are returned.\n\n@default true", @@ -9705,6 +9852,17 @@ "maximum": 50, "default": 2 }, + "speakerLabels": { + "description": "Provides friendly speaker labels that map to diarization indices (Speaker 1 -> labels[0]).", + "example": [ + "Agent", + "Customer" + ], + "type": "array", + "items": { + "type": "string" + } + }, "enablePartials": { "type": "boolean", "description": "This enables partial transcripts during speech recognition. When false, only final transcripts are returned.\n\n@default true", @@ -11325,11 +11483,151 @@ } ] }, + "voice": { + "description": "These are the options for the transfer assistant's voice.", + "oneOf": [ + { + "$ref": "#/components/schemas/AzureVoice", + "title": "AzureVoice" + }, + { + "$ref": "#/components/schemas/CartesiaVoice", + "title": "CartesiaVoice" + }, + { + "$ref": "#/components/schemas/CustomVoice", + "title": "CustomVoice" + }, + { + "$ref": "#/components/schemas/DeepgramVoice", + "title": "DeepgramVoice" + }, + { + "$ref": "#/components/schemas/ElevenLabsVoice", + "title": "ElevenLabsVoice" + }, + { + "$ref": "#/components/schemas/HumeVoice", + "title": "HumeVoice" + }, + { + "$ref": "#/components/schemas/LMNTVoice", + "title": "LMNTVoice" + }, + { + "$ref": "#/components/schemas/NeuphonicVoice", + "title": "NeuphonicVoice" + }, + { + "$ref": "#/components/schemas/OpenAIVoice", + "title": "OpenAIVoice" + }, + { + "$ref": "#/components/schemas/PlayHTVoice", + "title": "PlayHTVoice" + }, + { + "$ref": "#/components/schemas/RimeAIVoice", + "title": "RimeAIVoice" + }, + { + "$ref": "#/components/schemas/SmallestAIVoice", + "title": "SmallestAIVoice" + }, + { + "$ref": "#/components/schemas/TavusVoice", + "title": "TavusVoice" + }, + { + "$ref": "#/components/schemas/VapiVoice", + "title": "VapiVoice" + }, + { + "$ref": "#/components/schemas/SesameVoice", + "title": "SesameVoice" + }, + { + "$ref": "#/components/schemas/InworldVoice", + "title": "InworldVoice" + }, + { + "$ref": "#/components/schemas/MinimaxVoice", + "title": "MinimaxVoice" + } + ] + }, + "transcriber": { + "description": "These are the options for the transfer assistant's transcriber.", + "oneOf": [ + { + "$ref": "#/components/schemas/AssemblyAITranscriber", + "title": "AssemblyAITranscriber" + }, + { + "$ref": "#/components/schemas/AzureSpeechTranscriber", + "title": "AzureSpeechTranscriber" + }, + { + "$ref": "#/components/schemas/CustomTranscriber", + "title": "CustomTranscriber" + }, + { + "$ref": "#/components/schemas/DeepgramTranscriber", + "title": "DeepgramTranscriber" + }, + { + "$ref": "#/components/schemas/ElevenLabsTranscriber", + "title": "ElevenLabsTranscriber" + }, + { + "$ref": "#/components/schemas/GladiaTranscriber", + "title": "GladiaTranscriber" + }, + { + "$ref": "#/components/schemas/GoogleTranscriber", + "title": "GoogleTranscriber" + }, + { + "$ref": "#/components/schemas/SpeechmaticsTranscriber", + "title": "SpeechmaticsTranscriber" + }, + { + "$ref": "#/components/schemas/TalkscriberTranscriber", + "title": "TalkscriberTranscriber" + }, + { + "$ref": "#/components/schemas/OpenAITranscriber", + "title": "OpenAITranscriber" + }, + { + "$ref": "#/components/schemas/CartesiaTranscriber", + "title": "CartesiaTranscriber" + } + ] + }, "firstMessage": { "type": "string", "description": "This is the first message that the transfer assistant will say.\nThis can also be a URL to a custom audio file.\n\nIf unspecified, assistant will wait for user to speak and use the model to respond once they speak.", "example": "Hello! I understand you need to be transferred. Let me connect you." }, + "backgroundSound": { + "description": "This is the background sound in the transfer assistant call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", + "oneOf": [ + { + "type": "string", + "enum": [ + "off", + "office" + ], + "example": "office" + }, + { + "type": "string", + "format": "uri", + "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + } + ] + }, "firstMessageMode": { "type": "string", "description": "This is the mode for the first message. Default is 'assistant-speaks-first'.\n\nUse:\n- 'assistant-speaks-first' to have the assistant speak first.\n- 'assistant-waits-for-user' to have the assistant wait for the user to speak first.\n- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state.\n\n@default 'assistant-speaks-first'", @@ -25271,6 +25569,7 @@ "serverMessages": { "type": "array", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -25307,12 +25606,14 @@ "tool-calls", "transfer-destination-request", "handoff-destination-request", - "user-interrupted" + "user-interrupted", + "assistant.started" ], - "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.", + "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema.", "items": { "type": "string", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -26172,6 +26473,7 @@ "serverMessages": { "type": "array", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -26208,12 +26510,14 @@ "tool-calls", "transfer-destination-request", "handoff-destination-request", - "user-interrupted" + "user-interrupted", + "assistant.started" ], - "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.", + "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema.", "items": { "type": "string", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -26982,6 +27286,7 @@ "serverMessages": { "type": "array", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -27018,12 +27323,14 @@ "tool-calls", "transfer-destination-request", "handoff-destination-request", - "user-interrupted" + "user-interrupted", + "assistant.started" ], - "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.", + "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema.", "items": { "type": "string", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -27882,6 +28189,7 @@ "serverMessages": { "type": "array", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -27918,12 +28226,14 @@ "tool-calls", "transfer-destination-request", "handoff-destination-request", - "user-interrupted" + "user-interrupted", + "assistant.started" ], - "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.", + "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema.", "items": { "type": "string", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -30705,6 +31015,14 @@ "type": "number", "description": "This is the average latency for complete turns." }, + "fromTransportLatencyAverage": { + "type": "number", + "description": "This is the average latency for packets received from the transport provider in milliseconds." + }, + "toTransportLatencyAverage": { + "type": "number", + "description": "This is the average latency for packets sent to the transport provider in milliseconds." + }, "numUserInterrupted": { "type": "number", "description": "This is the number of times the user was interrupted by the assistant during the call." @@ -31749,6 +32067,7 @@ "call.in-progress.error-vapifault-eleven-labs-voice-not-allowed-for-free-users", "call.in-progress.error-vapifault-eleven-labs-max-character-limit-exceeded", "call.in-progress.error-vapifault-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification", + "call.in-progress.error-providerfault-eleven-labs-system-busy-and-requested-upgrade", "call.in-progress.error-providerfault-eleven-labs-500-server-error", "call.in-progress.error-providerfault-eleven-labs-503-server-error", "pipeline-error-playht-request-timed-out", @@ -32918,6 +33237,13 @@ "TwilioSMSChatTransport": { "type": "object", "properties": { + "conversationType": { + "type": "string", + "description": "This is the conversation type of the call (ie, voice or chat).", + "enum": [ + "chat" + ] + }, "phoneNumberId": { "type": "string", "description": "This is the phone number that will be used to send the SMS.\nIf provided, will create a new session. If not provided, uses existing session's phoneNumberId.\nThe phone number must have SMS enabled and belong to your organization." @@ -32944,6 +33270,7 @@ } }, "required": [ + "conversationType", "type" ] }, @@ -33074,6 +33401,10 @@ "type": "string", "description": "This is the unique identifier for the session that will be used for the chat." }, + "previousChatId": { + "type": "string", + "description": "This is the unique identifier for the previous chat to filter by." + }, "page": { "type": "number", "description": "This is the page number to return. Defaults to 1.", @@ -34385,6 +34716,14 @@ "type": "string", "description": "This is the ID of the workflow to filter sessions by." }, + "customer": { + "description": "This is the customer information to filter by.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + }, "page": { "type": "number", "description": "This is the page number to return. Defaults to 1.", @@ -39708,6 +40047,16 @@ "providerId" ] }, + "ComplianceOverride": { + "type": "object", + "properties": { + "forceStoreOnHipaaEnabled": { + "type": "boolean", + "description": "Force storage for this output under HIPAA. Only enable if output contains no sensitive data.", + "example": false + } + } + }, "StructuredOutput": { "type": "object", "properties": { @@ -39732,6 +40081,17 @@ } ] }, + "compliancePlan": { + "description": "Compliance configuration for this output. Only enable overrides if no sensitive data will be stored.", + "example": { + "forceStoreOnHipaaEnabled": false + }, + "allOf": [ + { + "$ref": "#/components/schemas/ComplianceOverride" + } + ] + }, "id": { "type": "string", "description": "This is the unique identifier for the structured output." @@ -39834,6 +40194,17 @@ } ] }, + "compliancePlan": { + "description": "Compliance configuration for this output. Only enable overrides if no sensitive data will be stored.", + "example": { + "forceStoreOnHipaaEnabled": false + }, + "allOf": [ + { + "$ref": "#/components/schemas/ComplianceOverride" + } + ] + }, "name": { "type": "string", "description": "This is the name of the structured output.", @@ -39896,6 +40267,17 @@ } ] }, + "compliancePlan": { + "description": "Compliance configuration for this output. Only enable overrides if no sensitive data will be stored.", + "example": { + "forceStoreOnHipaaEnabled": false + }, + "allOf": [ + { + "$ref": "#/components/schemas/ComplianceOverride" + } + ] + }, "name": { "type": "string", "description": "This is the name of the structured output.", @@ -39962,6 +40344,40 @@ "callIds" ] }, + "GenerateStructuredOutputSuggestionsDTO": { + "type": "object", + "properties": { + "assistantId": { + "type": "string", + "description": "The assistant ID to analyze and generate suggestions for", + "example": "550e8400-e29b-41d4-a716-446655440000" + }, + "count": { + "type": "number", + "description": "Number of suggestions to generate", + "minimum": 1, + "maximum": 10, + "default": 6 + }, + "excludeIds": { + "description": "Existing structured output IDs to exclude from suggestions", + "type": "array", + "items": { + "type": "string" + } + }, + "seed": { + "type": "number", + "description": "Iteration/seed for generating diverse suggestions (0 = first generation, 1+ = regenerations with increasing specificity)", + "minimum": 0, + "maximum": 10, + "default": 0 + } + }, + "required": [ + "assistantId" + ] + }, "TesterPlan": { "type": "object", "properties": { @@ -42641,6 +43057,10 @@ "$ref": "#/components/schemas/ChatEvalToolResponseMessageMock", "title": "ChatEvalToolResponseMessageMock" }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageEvaluation", + "title": "ChatEvalToolResponseMessageEvaluation" + }, { "$ref": "#/components/schemas/ChatEvalUserMessageMock", "title": "ChatEvalUserMessageMock" @@ -42700,6 +43120,10 @@ "$ref": "#/components/schemas/ChatEvalToolResponseMessageMock", "title": "ChatEvalToolResponseMessageMock" }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageEvaluation", + "title": "ChatEvalToolResponseMessageEvaluation" + }, { "$ref": "#/components/schemas/ChatEvalUserMessageMock", "title": "ChatEvalUserMessageMock" @@ -42796,6 +43220,10 @@ "$ref": "#/components/schemas/ChatEvalToolResponseMessageMock", "title": "ChatEvalToolResponseMessageMock" }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageEvaluation", + "title": "ChatEvalToolResponseMessageEvaluation" + }, { "$ref": "#/components/schemas/ChatEvalUserMessageMock", "title": "ChatEvalUserMessageMock" @@ -43018,36 +43446,6 @@ "judgePlan" ] }, - "AssistantMessageJudgePlanExact": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "exact" - ], - "description": "This is the type of the judge plan.\nUse 'exact' for an exact match on the content and tool calls - without using LLM-as-a-judge.\n@default 'exact'" - }, - "content": { - "type": "string", - "description": "This is what that will be used to evaluate the model's message content.\nIf you provide a string, the assistant message content will be evaluated against it as an exact match, case-insensitive.", - "example": "The weather in San Francisco is sunny.", - "maxLength": 1000 - }, - "toolCalls": { - "description": "This is the tool calls that will be used to evaluate the model's message content.\nThe tool name must be a valid tool that the assistant is allowed to call.\n\nFor the Query tool, the arguments for the tool call are in the format - {knowledgeBaseNames: ['kb_name', 'kb_name_2']}\n\nFor the DTMF tool, the arguments for the tool call are in the format - {dtmf: \"1234*\"}\n\nFor the Handoff tool, the arguments for the tool call are in the format - {destination: \"assistant_id\"}\n\nFor the Transfer Call tool, the arguments for the tool call are in the format - {destination: \"phone_number_or_assistant_id\"}\n\nFor all other tools, they are called without arguments or with user-defined arguments", - "example": "[{ name: \"get_weather\", arguments: { city: \"San Francisco\" } }]", - "type": "array", - "items": { - "$ref": "#/components/schemas/ChatEvalAssistantMessageMockToolCall" - } - } - }, - "required": [ - "type", - "content" - ] - }, "EvalOpenAIModel": { "type": "object", "properties": { @@ -43460,6 +43858,67 @@ "type" ] }, + "ChatEvalToolResponseMessageEvaluation": { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "tool" + ], + "description": "This is the role of the message author.\nFor a tool response message evaluation, the role is always 'tool'\n@default 'tool'", + "default": "tool" + }, + "judgePlan": { + "description": "This is the judge plan that instructs how to evaluate the tool response message.\nThe tool response message can be evaluated with an LLM-as-judge by defining the evaluation criteria in a prompt.", + "oneOf": [ + { + "$ref": "#/components/schemas/AssistantMessageJudgePlanAI", + "title": "AssistantMessageJudgePlanAI" + } + ], + "allOf": [ + { + "$ref": "#/components/schemas/AssistantMessageJudgePlanAI" + } + ] + } + }, + "required": [ + "role", + "judgePlan" + ] + }, + "AssistantMessageJudgePlanExact": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "exact" + ], + "description": "This is the type of the judge plan.\nUse 'exact' for an exact match on the content and tool calls - without using LLM-as-a-judge.\n@default 'exact'" + }, + "content": { + "type": "string", + "description": "This is what that will be used to evaluate the model's message content.\nIf you provide a string, the assistant message content will be evaluated against it as an exact match, case-insensitive.", + "example": "The weather in San Francisco is sunny.", + "maxLength": 1000 + }, + "toolCalls": { + "description": "This is the tool calls that will be used to evaluate the model's message content.\nThe tool name must be a valid tool that the assistant is allowed to call.\n\nFor the Query tool, the arguments for the tool call are in the format - {knowledgeBaseNames: ['kb_name', 'kb_name_2']}\n\nFor the DTMF tool, the arguments for the tool call are in the format - {dtmf: \"1234*\"}\n\nFor the Handoff tool, the arguments for the tool call are in the format - {destination: \"assistant_id\"}\n\nFor the Transfer Call tool, the arguments for the tool call are in the format - {destination: \"phone_number_or_assistant_id\"}\n\nFor all other tools, they are called without arguments or with user-defined arguments", + "example": "[{ name: \"get_weather\", arguments: { city: \"San Francisco\" } }]", + "type": "array", + "items": { + "$ref": "#/components/schemas/ChatEvalAssistantMessageMockToolCall" + } + } + }, + "required": [ + "type", + "content" + ] + }, "AssistantMessageJudgePlanRegex": { "type": "object", "properties": { @@ -43596,6 +44055,10 @@ "$ref": "#/components/schemas/ChatEvalToolResponseMessageMock", "title": "ChatEvalToolResponseMessageMock" }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageEvaluation", + "title": "ChatEvalToolResponseMessageEvaluation" + }, { "$ref": "#/components/schemas/ChatEvalUserMessageMock", "title": "ChatEvalUserMessageMock" @@ -53034,6 +53497,7 @@ "call.in-progress.error-vapifault-eleven-labs-voice-not-allowed-for-free-users", "call.in-progress.error-vapifault-eleven-labs-max-character-limit-exceeded", "call.in-progress.error-vapifault-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification", + "call.in-progress.error-providerfault-eleven-labs-system-busy-and-requested-upgrade", "call.in-progress.error-providerfault-eleven-labs-500-server-error", "call.in-progress.error-providerfault-eleven-labs-503-server-error", "pipeline-error-playht-request-timed-out", @@ -54330,6 +54794,7 @@ "call.in-progress.error-vapifault-eleven-labs-voice-not-allowed-for-free-users", "call.in-progress.error-vapifault-eleven-labs-max-character-limit-exceeded", "call.in-progress.error-vapifault-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification", + "call.in-progress.error-providerfault-eleven-labs-system-busy-and-requested-upgrade", "call.in-progress.error-providerfault-eleven-labs-500-server-error", "call.in-progress.error-providerfault-eleven-labs-503-server-error", "pipeline-error-playht-request-timed-out",