Skip to main content

Reverse engineered Edge Chat API

Project description

EdgeGPT

Edge GPT

The reverse engineering the chat feature of the new version of Bing

PyPI version Python version


Table of Contents

Setup

Install package

python3 -m pip install EdgeGPT --upgrade

Requirements

Checking access (Required)

  • Install the latest version of Microsoft Edge
  • Open http://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 (This saves your cookies to clipboard)
  • Paste your cookies into a file cookies.json

Usage

Quick start

 $ python3 -m EdgeGPT -h

        EdgeGPT - A demo of reverse engineering the Bing GPT chatbot
        Repo: github.com/acheong08/EdgeGPT
        By: Antonio Cheong

        !help for help

        Type !exit to exit
        Enter twice to send message

usage: EdgeGPT.py [-h] [--no-stream] --cookie-file COOKIE_FILE

options:
  -h, --help            show this help message and exit
  --no-stream
  --cookie-file COOKIE_FILE

Developer demo

Three ways to pass in cookies:

  • Environment variable: export COOKIE_FILE=/path/to/cookies.json.

  • Specify the path to cookies.json in the argument cookiePath like this:

    bot = Chatbot(cookiePath='./cookie.json')
    
  • Pass in the cookies directly by the argument cookies, like this:

    with open('./cookie.json', 'r') as f:
        cookies = json.load(f)
    bot = Chatbot(cookies=cookies)
    

Use Async for the best experience

Reference code for more advanced example of usage

import asyncio
from EdgeGPT import Chatbot

async def main():
    bot = Chatbot()
    print(await bot.ask(prompt="Hello world"))
    await bot.close()


if __name__ == "__main__":
    asyncio.run(main())

Work in progress

  • Error handling

Star History

Star History Chart

Contributors

This project exists thanks to all the people who contribute.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

EdgeGPT-0.0.53.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

EdgeGPT-0.0.53.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file EdgeGPT-0.0.53.1.tar.gz.

File metadata

  • Download URL: EdgeGPT-0.0.53.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for EdgeGPT-0.0.53.1.tar.gz
Algorithm Hash digest
SHA256 0640816f5873818d4637eebcf579e626c479f57175411585b89742dffd7100a0
MD5 ad09bd1cd20fcd777ab56dace53d9ed4
BLAKE2b-256 267c34720799fe286d7a7565706a548196443c2c7c5fd23fa9de558375ab1c61

See more details on using hashes here.

File details

Details for the file EdgeGPT-0.0.53.1-py3-none-any.whl.

File metadata

  • Download URL: EdgeGPT-0.0.53.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for EdgeGPT-0.0.53.1-py3-none-any.whl
Algorithm Hash digest
SHA256 813a4fd81c36e92b6be47f783b77df9ea1fbea3186cac116a8d3962b998c502e
MD5 f9d081a881789490f48d8acf57834a70
BLAKE2b-256 9e7190f45a033758be771e38497773b9578ba6116f453c36ca2a6cfa9ae750dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page