Socket
Socket
Sign inDemoInstall

@moonr/bingai

Package Overview
Dependencies
5
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @moonr/bingai

BingAI API using javascript


Version published
Maintainers
1
Created

Readme

Source

Bing AI API using node js

Update:

Fix issue in Any solution to prevent the bot forgot previous question? #2

Install

npm i bingai-js
  1. Go to https://bing.com/chat
  2. Copy cookies value named _U by using cookie editor extensions

Usage

/**
 * test.js
 */
const { ChatBot, conversation_style } = require("./index");
const pr = require("prompt-sync")();

const cookie = "Your-Cookie-U-here";

const a = new ChatBot(cookie);

async function test() {
  await a.init();
  var i = 0;
  await a.chatHub.init().then(async () => {
    while (true) {
      const prompt = pr("You: ");
      /**
       *   balanced : conversation_style.balanced
       *   creative : conversation_style.creative
       *   precise  : conversation_style.precise
       */
      const res = await a.ask(prompt, conversation_style.balanced, i);
      i++;
      console.log(`Bot: ${res}`);
    }
  });
}

test();
node test.js

Contributors

FAQs

Last updated on 26 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc