1.0.0 • Published 1 year ago
kanari-assistant-v1.0.0 v1.0.0
Kanari Web SDK
This package lets you to start kannari-assistant directly in your webapp.
Installation
You can install the package via npm:
npm install kanari-assistant
Usage
First, import the Kanari class from the package :
import Kanari from 'kanari-assistant'
Then, create a new instance of the Kanari class, passing your assistant-id as a parameter to the constructor :
const kassistant = new Kanari('your-assistant-id');
You can start the voice assistant by calling the start
method and passing an assistant
object :
kassistant.start({
model: {
provider: "openai",
model: "gpt-3.5-turbo",
messages: [
{
role: "system",
content: "You are an assistant.",
},
],
}
voice: {
name: "abeer",
voiceId: "3ec201c2-94d4-4762-bc07-7b1fbbe7cbb0",
}
});
The start
method will initiate the assistant.
You can stop the voice assistant by calling the stop
method :
kassistant.stop();
This will stop the assistant.
1.0.0
1 year ago