Fireaw.ai SDK
This is the official SDK for Fireaw.ai. It allows you to chat in real time with websites that you've configured on chat.ai.
Installation
npm i --save @fireaw.ai/sdk
Usage
import { ChatChannel } from "@fireaw.ai/sdk";
const channel = new ChatChannel({
apiToken: "<your api token here>",
chatbotId: "<your chatbot id here>",
onMessage: (message) => {
console.log(
`Received message: id=${message.id}, role=${message.role}, cost=${message.cost}, content=${message.content}`
);
},
});
channel.send("What kind of products do you have for sale?");