Integrate Millis AI’s voice agent capabilities directly into your web applications and browser extensions.
endPoint
to use HERE.
agent-id
with the ID of your agent obtained from the Playground.
The metadata
is optional. You can pass any additional data to the session, which we will forward to your custom LLM and function webhooks.
If you provide metadata
, you can make it available to the agent by setting include_metadata_in_prompt
to true
. This will include the metadata in the agent’s system prompt, allowing the agent to use the data during the conversation.
agent_id
and agent_config
are provided, the session will use the configuration associated with agent_id
but will override it with any settings provided in agent_config
. This option allows for minor modifications to the agent’s default configuration on a per-session basis.
metadata
: Optional field to pass any additional information that may personalize the conversation. It can be used by the agent if include_metadata_in_prompt
is set to true
.include_metadata_in_prompt
: Boolean flag (true
or false
). If true
, the metadata provided will be included in the prompt to give context to the agent.session_continuation
: Provide session_id
from a previous session to enable continuity in conversation. This allows the agent to reference previous interactions.onopen
onready
onsessionended
onaudio
audio
- The received audio data in Uint8Array
format.onresponsetext
text
- The received response text.payload
- An object containing additional information.
is_final
(optional) - A boolean indicating if the response text is final.ontranscript
text
- The received transcript text.payload
- An object containing additional information.
is_final
(optional) - A boolean indicating if the transcript text is final.onfunction
text
- Empty.payload
- Information about the triggered function.
name
- The function name.params
- The params being used in the function call.analyzer
AnalyserNode
for agent’s audio analysis.
Callback Signature:
analyzer
- The AnalyserNode
used for audio analysis.useraudioready
data
- An object containing audio-related information.
analyser
- The AnalyserNode
for user’s audio analysis.stream
- The MediaStream
containing the user’s audio data.onlatency
latency
- The measured latency in milliseconds.onclose
event
- The CloseEvent
containing details about the WebSocket closure.onerror
error
- The Event
containing details about the error.Client
class: