ChatGPT - 用于通过 OpenAI 与 ChatGPT 的 API 交互的轻量级包。使用反向工程的官方 API。

Created at: 2022-12-03 22:35:24
Language: Python
License: GPL-2.0

查特

皮皮 下载

OpenAI的逆向工程ChatGPT API。可扩展用于聊天机器人等。

LinkedIn上与我联系以支持这个项目。(尚未开放商业机会。太忙了)

你也可以在推特上关注我以保持最新状态。

此存储库的更新频率很高。预期重大更改。在更新或打开问题之前,请务必阅读文档和自述文件

基本模型接口

更新3 2023/02/08:模型始终过载。我正在恢复制作 ChatGPT 代理(无浏览器)服务的工作。请使用浏览器版本,直至另行通知。

免费、无浏览器且无速率限制。对 ChatGPT 使用过时的基本模型。

安装

pip3 install revChatGPT

设置

  1. OpenAI上创建帐户
  2. 转到 https://platform.openai.com/account/api-keys
  3. 复制接口密钥

用法

命令行

python3 -m revChatGPT.Official --api_key API_KEY --stream

开发 人员

异步和同步都可用。你还可以通过生成器流式传输响应。阅读示例代码以了解更多信息

示例代码

你可以在这里找到它

更多文档

你可以找到它维基

聊天GPT网站版本

浏览器是必需的。违反服务条款。

安装

pip3 install revChatGPT[unofficial]

配置

  1. OpenAI的ChatGPT上创建帐户
  2. 保存你的电子邮件和密码

所需配置:

{
  "email": "<your email>",
  "password": "your password"
}

可选配置:

{
  "conversation_id": "UUID...",
  "parent_id": "UUID...",
  "proxy": "...",
}
  1. 另存为
    $HOME/.config/revChatGPT/config.json

用法

命令行

python3 -m revChatGPT.Unofficial

!help - Show this message
!reset - Forget the current conversation
!refresh - Refresh the session authentication
!config - Show the current configuration
!rollback x - Rollback the conversation (x being the number of messages to rollback)
!exit - Exit this program

开发 人员

from revChatGPT.Unofficial import Chatbot

chatbot = Chatbot({
  "email": "<your email>",
  "password": "your password"
}, conversation_id=None, parent_id=None) # You can start a custom conversation

response = chatbot.ask("Prompt", conversation_id=None, parent_id=None) # You can specify custom conversation and parent ids. Otherwise it uses the saved conversation (yes. conversations are automatically saved)

print(response)
# {
#   "message": message,
#   "conversation_id": self.conversation_id,
#   "parent_id": self.parent_id,
# }

有关高级开发人员用法,请参阅 wiki

应用程序接口

python3 -m revChatGPT.GPTserver

HTTP POST 请求:

{
  "session_token": "eyJhbGciOiJkaXIiL...",
  "prompt": "Your prompt here"
}

自选:

{
  "session_token": "eyJhbGciOiJkaXIiL...",
  "prompt": "Your prompt here",
  "conversation_id": "UUID...",
  "parent_id": "UUID..."
}
  • 默认情况下启用速率限制以防止同时请求

awesome 聊天GPT

我的列表

如果要将很酷的项目添加到列表中,请打开一个问题。

免责 声明

这不是官方的OpenAI产品。这是一个个人项目,与OpenAI没有任何关系。不要起诉我

捐赠