bing-chat
bing-chat copied to clipboard
Use in a normal nodejs program...
after issuing npm install bing-chat, I tried this:
$ cat >chat.js
import { BingChat } from 'bing-chat';
async function main() {
// Initialize the API with your valid cookie
const api = new BingChat({ cookie: process.env.BING_COOKIE });
// Send a message to Bing Chat
const response = await api.sendMessage('Hello, how can I help?');
console.log('Bing Chat response:', response.text);
}
main();
then
node chat.js
obviously import can't be used outside a module so it does not work. how can I use it in a normal main.js file executed as node main.js ?
Done:
import('bing-chat').then(_=>{
BingChat=_.BingChat;
async function main() {
// Initialize the API with your valid cookie
const api = new BingChat({ cookie: process.env.BING_COOKIE });
// Send a message to Bing Chat
const response = await api.sendMessage('Hello, how can I help?');
console.log('Bing Chat response:', response.text);
}
main();
});
i am getting blank response. any ideas ? also my cookies do not have any _U cookie, did anything change in Bing ?
i am getting blank response. any ideas ? also my cookies do not have any _U cookie, did anything change in Bing ?
same with me