1.7.5 • Published 2 months ago
bingai-js v1.7.5
Bing AI API using node js
Update v1.7.5-rc6:
Support Typescript
Install
npm i bingai-js@1.7.5.-rc6
or
npm i bingai-js
Getting cookie
- Go to https://bing.com/chat
- Copy cookies value named
_U
by using cookie editor extensions
Usage
// if using ESM
import { ChatBot, conversation_style } from "bingai-js";
import promptSync from "prompt-sync";
// if using commonJS
const { ChatBot, conversation_style } = require("bingai-js/index.cjs");
const promptSync = require("prompt-sync");
const pr = promptSync();
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 index.js
Contributors
1.7.5
2 months ago
1.7.5-rc6
2 months ago
1.7.5-rc5
2 months ago
1.7.5-rc2
2 months ago
1.7.5-rc4
2 months ago
1.7.5-rc3
2 months ago
1.7.5-rc1
2 months ago
1.7.3
4 months ago
1.7.2
4 months ago
1.7.4
4 months ago
1.7.1
4 months ago
1.7.0
7 months ago
1.6.0
7 months ago
1.5.0
7 months ago
1.0.4
8 months ago
1.0.3
8 months ago
1.0.2
8 months ago
1.0.1
8 months ago
1.0.0
8 months ago