Skip to content

a Node.js package inspired by the Python version [EdgeGPT](https://github.com/acheong08/EdgeGPT) repository.

Notifications You must be signed in to change notification settings

can-non/EdgeGPTJs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EdgeGPTJs

English | 简体中文 npm version License: MIT

EdgeGPTJs Logo

Welcome to EdgeGPTJs, a Node.js package inspired by the Python version EdgeGPT repository. This package allows you to reverse engineer the chat feature of the new version of Bing, making it easier than ever to leverage the power of Bing's chat capabilities within your own projects.

Table of Contents

Features

  • Reverse engineer the chat feature of the new version of Bing
  • Easy-to-use API with thorough documentation
  • Highly customizable and extendable

Roadmap

Requirements

  • A Microsoft Account with early access to https://bing.com/chat (Required)
  • Required in a supported country with New Bing (Chinese mainland VPN required)

Checking access (Required)

  • Install the latest version of Microsoft Edge

  • Alternatively, you can use any browser and set the user-agent to look like you're using Edge (e.g., Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51). You can do this easily with an extension like "User-Agent Switcher and Manager" for Chrome and Firefox.

  • Open bing.com/chat

  • If you see a chat feature, you are good to go

Getting authentication (Required)

  • Install the cookie editor extension for Chrome or Firefox

  • Go to bing.com

  • Open the extension

  • Click "Export" on the bottom right, then "Export as JSON" (This saves your cookies to clipboard)

  • Paste your cookies into a file cookies.json

Prompt Tool Usage

use ENVIRONMENT_VARIABLE to pass cookie jar file.

export COOKIE_FILE=/path/to/cookie.json
npx edgegptjs

or use

npx edgegptjs --cookie-file=cookie.json

Library Usage

To get started with EdgeGPTJs, import the package and create a new instance of Chatbot:

const { Chatbot } = require('edgegptjs');
const bot = new Chatbot(args.cookiePath);
await bot.chatHubInitialization;
const response = await bot.ask("What's the result of 1+1?");
console.log(`Bot: ${response}`);

For a detailed explanation of the API and available methods, please refer to the documentation.

Contributing

All Contributors

We welcome contributions from the community. If you'd like to contribute to EdgeGPTJs, please read our contributing guidelines to get started.

License

EdgeGPTJs is released under the MIT License.

Star History

About

a Node.js package inspired by the Python version [EdgeGPT](https://github.com/acheong08/EdgeGPT) repository.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.1%
  • JavaScript 6.9%