bing-chatai-client

1.0.2 • Public • Published

Bing chatai client

Uses bingchat-api for backend.

Pre-requisites

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);
    });

Created by Tuhin Kanti Pal

Readme

Keywords

Package Sidebar

Install

npm i bing-chatai-client

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

5.79 kB

Total Files

4

Last publish

Collaborators

  • tuhinpal