Integrate Vapi into your web application.
.start()
.start()
function. The start
function can either accept:
assistantOverrides
as the second argument.
For example, if the first message is “Hello {{name}}
”, set assistantOverrides
to the following to replace {{name}}
with John
:
.send()
type
will always be "add-message"
message
field will have 2 items, role
and content
.system
, user
, assistant
, tool
or
function
..stop()
stop
method:
.isMuted()
.setMuted(muted: boolean)
setMuted
:
say(message: string, endCallAfterSpoken?: boolean)
say
method can be used to invoke speech and gracefully terminate the call if needed
vapi
instance for events. These events allow you to react to changes in the state of the call or user speech.
speech-start
speech-end
call-start
call-end
volume-level
0
& 1
.
message
clientMessages
field the set of messages you’d like the assistant to send back to the client.
Those messages will come back via the message
event:
error