Installation
Install the Ponder web sdk using NPMnpm install @ponderai/web
Ponder
The Ponder class is the main class that exposes all Ponder’s functionality
example
Params
string
the id of the assistant that is created on the dashboard
string
url of the Ponder backend, usually https://api.useponder.ai unless self hosted
string
instructions for the agent, these get added to the system prompt from the dashboard
array
a list of actions / function the agent can call. format is the same as react sdk - refer it for schema
Properties
function
starts a web call
example
function
stops a web call
example
callback
callback function called when the call is connected and the agent is listening
example
callback
callback function called when the call is disconnected and the agent is no longer listening
example
function
callback function for whenever user speech start is detected
does not have any arguments
does not have any arguments
example
function
callback function for whenever user is done speaking
does not have any arguments
does not have any arguments
example
function
callback for whenever there is a new message added to the conversation
for example when the user’s speech is transcribed, or when the agent’s response is recieved
for example when the user’s speech is transcribed, or when the agent’s response is recieved
example
function
callback for whenever the agent decides to call a function
has the
has the
name - function name and args - arguments of the function as parametersexample