1.0.2 • Published 1 year ago

bing-chatai-client v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago