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
the id of the assistant that is created on the dashboard
url of the Ponder backend, usually https://api.useponder.ai unless self hosted
instructions for the agent, these get added to the system prompt from the dashboard
a list of actions / function the agent can call. format is the same as react sdk - refer it for schema
Properties
starts a web call
example
stops a web call
example
callback function called when the call is connected and the agent is listening
example
callback function called when the call is disconnected and the agent is no longer listening
example
callback function for whenever user speech start is detected
does not have any arguments
does not have any arguments
example
callback function for whenever user is done speaking
does not have any arguments
does not have any arguments
example
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
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