Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@moonr/bingai

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@moonr/bingai

BingAI API using javascript

  • 1.0.0
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 26 Jan 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc