Introduction to EdgeGPT
EdgeGPT, an intriguing project by Antonio Cheong, focuses on reverse-engineering the chat feature of the new Bing version. Despite being archived due to lack of maintenance time, it remains a valuable tool for understanding how chatbots can emulate human conversation by leveraging Bing's capabilities.
Overview
EdgeGPT provides users the ability to interact with Bing's chat feature through a Python library. It aims to replicate the chatbot's functions, offering a glimpse into the interaction between users and an AI-powered chat service like Bing.
Setup and Installation
To get started with EdgeGPT, users must have Python 3.8 or higher. Installing EdgeGPT is straightforward using pip:
python3 -m pip install EdgeGPT --upgrade
For regions where Microsoft's chat feature is less accessible, users might require a Microsoft account and a supported VPN like a Chinese mainland VPN. Additionally, Selenium is utilized for automatic cookie setup, simplifying the authentication process.
Authentication
In certain regions, EdgeGPT does not require logging in if the chat feature is freely accessible. Otherwise, users may need to export their browser cookies (resembled as using Microsoft Edge) as JSON files named following a specific pattern such as bing_cookies_*.json
. These cookies facilitate bypassing restrictions allowing access to the chat features.
Using EdgeGPT
EdgeGPT can be utilized via the command line or directly within Python code.
Command Line Usage
The command-line tool offers various options including proxy settings, conversation styles (creative, balanced, precise), and configuration with cookie and history files. Users can customize their experience by specifying prompts and locales.
Python Usage
In Python, EdgeGPT is employed through the Chatbot
class, providing control over interactions via asynchronous functions:
import asyncio, json
from EdgeGPT.EdgeGPT import Chatbot, ConversationStyle
async def main():
bot = await Chatbot.create() # Optional cookie use
response = await bot.ask(prompt="Hello, world", conversation_style=ConversationStyle.creative, simplify_response=True)
print(json.dumps(response, indent=2))
await bot.close()
if __name__ == "__main__":
asyncio.run(main())
Additionally, the use of helper classes like Query
and Cookie
assists in managing queries and handling cookies, enabling streamlined access to Bing's chat capabilities.
Image Generation
EdgeGPT includes features for generating images from text prompts via the ImageGen
class. Users can generate and save images based on prompts, with options to run the process using asyncio for efficiency.
Docker Integration
For users preferring containerized environments, EdgeGPT supports Docker. Users can execute EdgeGPT within Docker, facilitating a controlled and isolated setup.
Contributions
The project is a collaborative effort with several contributors, thriving on the collective input from the open-source community.
EdgeGPT captures the essence of combining reverse engineering with user interaction, showing the potential of chatbots and AI-driven communication platforms. Through its setup, flexible usage, and comprehensive features, EdgeGPT offers an insightful exploration of Bing's chat capabilities.