bing-chatai-client
v1.0.2
Published
Bing chatai client
Downloads
3
Readme
Bing chatai client
Uses bingchat-api for backend.
Pre-requisites
- You need to have a bingchat-api server running
Installation
npm install bing-chatai-client
Implementation
Create a new conversation
import { createConversation, Generate } from "bing-chatai-client"; const conversation = await createConversation("http://localhost:8080"); console.log(conversation);
Send a message
import { createConversation, Generate } from "bing-chatai-client"; const gen = new Generate(conversation.conversationUrl); gen.generate("Hello bing what is an ai?"); gen.onMessage((data) => { console.log(data); }); gen.onFinished((message) => { console.info(message); }); gen.onError((message) => { console.error(message); });