export interface DeepgramTranscriber { provider: "deepgram"; model?: "nova-2" | "nova-2-general" | "nova-2-meeting" | "nova-2-phonecall" | "nova-2-finance" | "nova-2-conversationalai" | "nova-2-voicemail" | "nova-2-video" | "nova-2-medical" | "nova-2-drivethru" | "nova-2-automotive" | "nova" | "nova-general" | "nova-phonecall" | "nova-medical" | "enhanced" | "enhanced-general" | "enhanced-meeting" | "enhanced-phonecall" | "enhanced-finance" | "base" | "base-general" | "base-meeting" | "base-phonecall" | "base-finance" | "base-conversationalai" | "base-voicemail" | "base-video" | string; language?: "cs" | "da" | "da-DK" | "de-CH" | "nl" | "en" | "en-US" | "en-AU" | "en-GB" | "en-NZ" | "en-IN" | "nl-BE" | "fr" | "fr-CA" | "de" | "el" | "hi" | "hi-Latn" | "id" | "it" | "ja" | "ko" | "ko-KR" | "no" | "pl" | "pt" | "pt-BR" | "ru" | "es" | "es-419" | "sv" | "sv-SE" | "tr" | "uk" | "zh" | "zh-CN" | "zh-TW"; smartFormat?: boolean; keywords?: string[]; } export interface TalkscriberTranscriber { provider: "talkscriber"; model: "whisper"; language?: "en" | "zh" | "de" | "es" | "ru" | "ko" | "fr" | "ja" | "pt" | "tr" | "pl" | "ca" | "nl" | "ar" | "sv" | "it" | "id" | "hi" | "fi" | "vi" | "he" | "uk" | "el" | "ms" | "cs" | "ro" | "da" | "hu" | "ta" | "no" | "th" | "ur" | "hr" | "bg" | "lt" | "la" | "mi" | "ml" | "cy" | "sk" | "te" | "fa" | "lv" | "bn" | "sr" | "az" | "sl" | "kn" | "et" | "mk" | "br" | "eu" | "is" | "hy" | "ne" | "mn" | "bs" | "kk" | "sq" | "sw" | "gl" | "mr" | "pa" | "si" | "km" | "sn" | "yo" | "so" | "af" | "oc" | "ka" | "be" | "tg" | "sd" | "gu" | "am" | "yi" | "lo" | "uz" | "fo" | "ht" | "ps" | "tk" | "nn" | "mt" | "sa" | "lb" | "my" | "bo" | "tl" | "mg" | "as" | "tt" | "haw" | "ln" | "ha" | "ba" | "jw" | "su" | "yue"; } export interface JsonSchema { type: "string" | "number" | "integer" | "boolean" | "array" | "object"; items?: JsonSchema; prefixItems?: JsonSchema[]; contains?: JsonSchema; properties?: Record; patternProperties?: Record; additionalProperties?: JsonSchema; dependentSchemas?: Record; propertyNames?: JsonSchema; unevaluatedProperties?: JsonSchema; const?: any; not?: JsonSchema; oneOf?: JsonSchema[]; anyOf?: JsonSchema[]; allOf?: JsonSchema[]; if?: JsonSchema; then?: JsonSchema; else?: JsonSchema; title?: string; description?: string; multipleOf?: number; maximum?: number; exclusiveMaximum?: number; minimum?: number; exclusiveMinimum?: number; maxLength?: number; minLength?: number; pattern?: string; format?: string; maxItems?: number; minItems?: number; minContains?: number; maxContains?: number; maxProperties?: number; minProperties?: number; required?: string[]; dependentRequired?: Record; enum?: any[]; $id?: string; $ref?: string; $schema?: string; $comment?: string; default?: any; examples?: any[]; readOnly?: boolean; writeOnly?: boolean; contentEncoding?: string; contentMediaType?: string; } export interface OpenAIFunctionParameters { type: "object"; properties: Record; required?: string[]; } export interface OpenAIFunction { name: string; description?: string; parameters?: OpenAIFunctionParameters; async?: boolean; serverUrl?: string; serverUrlSecret?: string; } export interface Server { url: string; secret?: string; } export interface Condition { param: string; value: any; operator: "eq" | "neq" | "gt" | "gte" | "lt" | "lte"; } export interface ToolMessageStart { type: "request-start"; content: string; conditions?: Condition[]; } export interface ToolMessageComplete { type: "request-complete"; content: string; conditions?: Condition[]; } export interface ToolMessageFailed { type: "request-failed"; content: string; conditions?: Condition[]; } export interface ToolMessageDelayed { type: "request-response-delayed"; content: string; timingMilliseconds: number; conditions?: Condition[]; } export type FunctionToolMessage = ToolMessageStart | ToolMessageComplete | ToolMessageFailed | ToolMessageDelayed; export interface FunctionTool { type: "function"; messages?: FunctionToolMessage[]; function: OpenAIFunction; server?: Server; async?: boolean; } export interface TransferCallTool { type: "transferCall"; messages?: (ToolMessageStart | ToolMessageComplete | ToolMessageFailed | ToolMessageDelayed)[]; destinations?: any[]; server?: Server; function?: OpenAIFunction; } export interface EndCallTool { type: "endCall"; messages?: (ToolMessageStart | ToolMessageComplete | ToolMessageFailed | ToolMessageDelayed)[]; function?: OpenAIFunction; } export interface DtmfTool { type: "dtmf"; messages?: (ToolMessageStart | ToolMessageComplete | ToolMessageFailed | ToolMessageDelayed)[]; function?: OpenAIFunction; } export type OpenAIMessageRole = "assistant" | "function" | "user" | "system" | "tool"; export interface OpenAIMessage { content: string | null; role: OpenAIMessageRole; function_call?: any; tool_calls?: any[]; tool_call_id?: string; } export interface KnowledgeBase { topK?: number; fileIds: string[]; provider: "canonical"; } export interface TogetherAIModel { messages?: OpenAIMessage[]; tools?: (TransferCallTool | FunctionTool | EndCallTool | DtmfTool)[]; provider: "together-ai"; model: string; temperature?: number; knowledgeBase?: KnowledgeBase; maxTokens?: number; emotionRecognitionEnabled?: boolean; } export interface AnyscaleModel { messages?: OpenAIMessage[]; tools?: (TransferCallTool | FunctionTool | EndCallTool | DtmfTool)[]; provider: "anyscale"; model: string; temperature?: number; knowledgeBase?: KnowledgeBase; maxTokens?: number; emotionRecognitionEnabled?: boolean; } export interface OpenRouterModel { messages?: OpenAIMessage[]; tools?: (TransferCallTool | FunctionTool | EndCallTool | DtmfTool)[]; provider: "openrouter"; model: string; temperature?: number; knowledgeBase?: KnowledgeBase; maxTokens?: number; emotionRecognitionEnabled?: boolean; } export interface PerplexityAIModel { messages?: OpenAIMessage[]; tools?: (TransferCallTool | FunctionTool | EndCallTool | DtmfTool)[]; provider: "perplexity-ai"; model: string; temperature?: number; knowledgeBase?: KnowledgeBase; maxTokens?: number; emotionRecognitionEnabled?: boolean; } export interface DeepInfraModel { messages?: OpenAIMessage[]; tools?: (TransferCallTool | FunctionTool | EndCallTool | DtmfTool)[]; provider: "deepinfra"; model: string; temperature?: number; knowledgeBase?: KnowledgeBase; maxTokens?: number; emotionRecognitionEnabled?: boolean; } export interface CustomLLMModel { messages?: OpenAIMessage[]; tools?: (TransferCallTool | FunctionTool | EndCallTool | DtmfTool)[]; provider: "custom-llm"; url: string; urlRequestMetadataEnabled?: boolean; model?: string; temperature?: number; knowledgeBase?: KnowledgeBase; maxTokens?: number; emotionRecognitionEnabled?: boolean; } export interface GroqModel { messages?: OpenAIMessage[]; tools?: (TransferCallTool | FunctionTool | EndCallTool | DtmfTool)[]; model: "mixtral-8x7b-32768" | "llama3-8b-8192" | "llama3-70b-8192"; provider: "groq"; temperature?: number; knowledgeBase?: KnowledgeBase; maxTokens?: number; emotionRecognitionEnabled?: boolean; } export interface AnthropicModel { messages?: OpenAIMessage[]; tools?: (TransferCallTool | FunctionTool | EndCallTool | DtmfTool)[]; model: "claude-3-opus-20240229" | "claude-3-sonnet-20240229" | "claude-3-haiku-20240307"; provider: "anthropic"; temperature?: number; knowledgeBase?: KnowledgeBase; maxTokens?: number; emotionRecognitionEnabled?: boolean; } export interface DeepgramVoice { inputPreprocessingEnabled?: boolean; inputMinCharacters?: number; inputPunctuationBoundaries?: ("。" | "," | "." | "!" | "?" | ";" | ")" | "،" | "۔" | "।" | "॥" | "|" | "||" | "," | ":")[]; fillerInjectionEnabled?: boolean; provider: "deepgram"; voiceId: "asteria" | "luna" | "stella" | "athena" | "hera" | "orion" | "arcas" | "perseus" | "angus" | "orpheus" | "helios" | "zeus" | string; } export interface ElevenLabsVoice { inputPreprocessingEnabled?: boolean; inputMinCharacters?: number; inputPunctuationBoundaries?: ("。" | "," | "." | "!" | "?" | ";" | ")" | "،" | "۔" | "।" | "॥" | "|" | "||" | "," | ":")[]; fillerInjectionEnabled?: boolean; provider: "11labs"; voiceId: "burt" | "marissa" | "andrea" | "sarah" | "phillip" | "steve" | "joseph" | "myra" | "paula" | "ryan" | "drew" | "paul" | "mrb" | "matilda" | "mark" | string; stability?: number; similarityBoost?: number; style?: number; useSpeakerBoost?: boolean; optimizeStreamingLatency?: number; enableSsmlParsing?: boolean; model?: "eleven_multilingual_v2" | "eleven_turbo_v2" | "eleven_monolingual_v1"; } export type LLMTool = TransferCallTool | FunctionTool | EndCallTool | DtmfTool; export interface OpenAIModel { messages?: OpenAIMessage[]; tools?: LLMTool[]; provider: "openai"; model: "gpt-4o" | "gpt-4o-2024-05-13" | "gpt-4-turbo" | "gpt-4-turbo-2024-04-09" | "gpt-4-turbo-preview" | "gpt-4-0125-preview" | "gpt-4-1106-preview" | "gpt-4" | "gpt-4-0613" | "gpt-3.5-turbo" | "gpt-3.5-turbo-0125" | "gpt-3.5-turbo-1106" | "gpt-3.5-turbo-16k" | "gpt-3.5-turbo-0613"; fallbackModels?: ("gpt-4o" | "gpt-4o-2024-05-13" | "gpt-4-turbo" | "gpt-4-turbo-2024-04-09" | "gpt-4-turbo-preview" | "gpt-4-0125-preview" | "gpt-4-1106-preview" | "gpt-4" | "gpt-4-0613" | "gpt-3.5-turbo" | "gpt-3.5-turbo-0125" | "gpt-3.5-turbo-1106" | "gpt-3.5-turbo-16k" | "gpt-3.5-turbo-0613")[]; semanticCachingEnabled?: boolean; numFastTurns?: number; temperature?: number; knowledgeBase?: KnowledgeBase; maxTokens?: number; emotionRecognitionEnabled?: boolean; functions?: OpenAIFunction[]; } export interface PlayHTVoice { inputPreprocessingEnabled?: boolean; inputMinCharacters?: number; inputPunctuationBoundaries?: ("。" | "," | "." | "!" | "?" | ";" | ")" | "،" | "۔" | "।" | "॥" | "|" | "||" | "," | ":")[]; fillerInjectionEnabled?: boolean; provider: "playht"; voiceId: "jennifer" | "melissa" | "will" | "chris" | "matt" | "jack" | "ruby" | "davis" | "donna" | "michael" | string; speed?: number; temperature?: number; emotion?: "female_happy" | "female_sad" | "female_angry" | "female_fearful" | "female_disgust" | "female_surprised" | "male_happy" | "male_sad" | "male_angry" | "male_fearful" | "male_disgust" | "male_surprised"; voiceGuidance?: number; styleGuidance?: number; textGuidance?: number; } export interface RimeAIVoice { inputPreprocessingEnabled?: boolean; inputMinCharacters?: number; inputPunctuationBoundaries?: ("。" | "," | "." | "!" | "?" | ";" | ")" | "،" | "۔" | "।" | "॥" | "|" | "||" | "," | ":")[]; fillerInjectionEnabled?: boolean; provider: "rime-ai"; voiceId: "abbie" | "allison" | "ally" | "alona" | "amber" | "ana" | "antoine" | "armon" | "brenda" | "brittany" | "carol" | "colin" | "courtney" | "elena" | "elliot" | "eva" | "geoff" | "gerald" | "hank" | "helen" | "hera" | "jen" | "joe" | "joy" | "juan" | "kendra" | "kendrick" | "kenneth" | "kevin" | "kris" | "linda" | "madison" | "marge" | "marina" | "marissa" | "marta" | "maya" | "nicholas" | "nyles" | "phil" | "reba" | "rex" | "rick" | "ritu" | "rob" | "rodney" | "rohan" | "rosco" | "samantha" | "sandy" | "selena" | "seth" | "sharon" | "stan" | "tamra" | "tanya" | "tibur" | "tj" | "tyler" | "viv" | "yadira" | string; speed?: number; } export interface OpenAIVoice { inputPreprocessingEnabled?: boolean; inputMinCharacters?: number; inputPunctuationBoundaries?: ("。" | "," | "." | "!" | "?" | ";" | ")" | "،" | "۔" | "।" | "॥" | "|" | "||" | "," | ":")[]; fillerInjectionEnabled?: boolean; provider: "openai"; voiceId: "alloy" | "echo" | "fable" | "onyx" | "nova" | "shimmer" | string; speed?: number; } export interface AzureVoice { inputPreprocessingEnabled?: boolean; inputMinCharacters?: number; inputPunctuationBoundaries?: ("。" | "," | "." | "!" | "?" | ";" | ")" | "،" | "۔" | "।" | "॥" | "|" | "||" | "," | ":")[]; fillerInjectionEnabled?: boolean; provider: "azure"; voiceId: "andrew" | "brian" | "emma" | string; speed?: number; } export interface LMNTVoice { inputPreprocessingEnabled?: boolean; inputMinCharacters?: number; inputPunctuationBoundaries?: ("。" | "," | "." | "!" | "?" | ";" | ")" | "،" | "۔" | "।" | "॥" | "|" | "||" | "," | ":")[]; fillerInjectionEnabled?: boolean; provider: "lmnt"; voiceId: "lily" | "daniel" | string; speed?: number; } export interface NeetsVoice { inputPreprocessingEnabled?: boolean; inputMinCharacters?: number; inputPunctuationBoundaries?: ("。" | "," | "." | "!" | "?" | ";" | ")" | "،" | "۔" | "।" | "॥" | "|" | "||" | "," | ":")[]; fillerInjectionEnabled?: boolean; provider: "neets"; voiceId: "lily" | "daniel" | string; } export type VapiServerMessage = "status-update" | "transcript" | "hang" | "function-call" | "tool-calls" | "end-of-call-report" | "conversation-update" | "phone-call-control" | "model-output" | "voice-input"; export interface VapiAssistant { isServerUrlSecretSet?: boolean; transcriber?: DeepgramTranscriber | TalkscriberTranscriber; model?: OpenAIModel | TogetherAIModel | AnyscaleModel | OpenRouterModel | PerplexityAIModel | DeepInfraModel | GroqModel | AnthropicModel | CustomLLMModel | any; voice?: AzureVoice | ElevenLabsVoice | PlayHTVoice | RimeAIVoice | DeepgramVoice | OpenAIVoice | LMNTVoice | NeetsVoice; forwardingPhoneNumber?: string; firstMessageMode?: "assistant-speaks-first" | "assistant-waits-for-user"; voicemailDetectionTypes?: ("machine_start" | "human" | "fax" | "unknown" | "machine_end_beep" | "machine_end_silence" | "machine_end_other")[]; recordingEnabled?: boolean; endCallFunctionEnabled?: boolean; dialKeypadFunctionEnabled?: boolean; hipaaEnabled?: boolean; clientMessages?: ("status-update" | "speech-update" | "transcript" | "hang" | "function-call" | "tool-calls" | "metadata" | "conversation-update" | "model-output" | "voice-input")[]; serverMessages?: VapiServerMessage[]; silenceTimeoutSeconds?: number; responseDelaySeconds?: number; llmRequestDelaySeconds?: number; numWordsToInterruptAssistant?: number; maxDurationSeconds?: number; backgroundSound?: "off" | "office"; backchannelingEnabled?: boolean; name?: string; firstMessage?: string; voicemailDetectionEnabled?: boolean; voicemailMessage?: string; endCallMessage?: string; endCallPhrases?: string[]; metadata?: any; serverUrl?: string; serverUrlSecret?: string; summaryPrompt?: string; id?: string; orgId?: string; createdAt?: string; updatedAt?: string; }