Giter Site home page Giter Site logo

pengzhile / pandora Goto Github PK

View Code? Open in Web Editor NEW
21.1K 21.1K 4.1K 4.12 MB

潘多拉,一个让你呼吸顺畅的ChatGPT。Pandora, a ChatGPT that helps you breathe smoothly.

Home Page: https://chat.zhile.io

License: GNU General Public License v2.0

Dockerfile 0.29% Python 90.09% Shell 1.02% JavaScript 0.08% HTML 8.52%
chatgpt chatgpt-plus gpt-35-burbo gpt-35-turbo-0301 gpt-4 php python

pandora's Introduction

Profile

pandora's People

Contributors

br7roy avatar c2ray avatar f-unction avatar fireinrain avatar pengzhile avatar zeddit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pandora's Issues

error occurred after run pandora

❯ pandora

    Pandora - A command-line interface to ChatGPT
    Github: https://github.com/pengzhile/pandora

A saved access token has been detected. Do you want to use it? [y/n/del] (n): y
==================== New Chat ====================
Double enter to send. Type /? for help.
You:
你好

ChatGPT:

Error occurred: Cannot connect to host apps.openai.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL:

CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]

历史记录消失

大佬您好,非常感谢您提供的这个工具,个人使用十分便利,但今天在使用时突然发现没法读取历史纪录了,上来github看了一下您这几天更新了好几个版本,我开始用的是0.4的版本,训练了几个回答问题的模型,今天不管是升级前还是升级后,训练的几个都没了,这个可以怎么解决么?
image

写了一个docker-compose文件,可以更加方便docker一键运行

version: '3.3'
services:
  pandora:
    image: pengzhile/pandora
    container_name: pandoraGPT
#这里host模式是为用本机设置的cf-warp代理
    network_mode: host
    volumes:
      - ./data:/data
    environment:
      - PANDORA_SERVER=0.0.0.0:23460
      - PANDORA_PROXY=socks5://127.0.0.1:40000
      - PANDORA_ACCESS_TOKEN={获取的accessToken}
      - PANDORA_API=true
    restart: unless-stopped

win10 命令行中文乱码

在win10中使用cmd或者powershell会包含乱码,ChatGPT的回答也会包含乱码。编码已通过chcp 65001命令改为了utf-8
无标题2
无标题

接口404

大佬您好,接口好像404了

ProxyError: HTTPSConnectionPool(host='apps.openai.com', port=443): Max retries exceeded with url: /api/conver...

Sentry Issue: PANDORA-Z

ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
(3 additional frame(s) were not displayed)
...
  File "urllib3\util\ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "urllib3\util\ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "ssl.py", line 1071, in _create
    self.do_handshake()
  File "ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()

MaxRetryError: HTTPSConnectionPool(host='apps.openai.com', port=443): Max retries exceeded with url: /api/conversations?offset=0&limit=20 (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)))
  File "requests\adapters.py", line 489, in send
    resp = conn.urlopen(
  File "urllib3\connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "urllib3\util\retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))

ProxyError: HTTPSConnectionPool(host='apps.openai.com', port=443): Max retries exceeded with url: /api/conversations?offset=0&limit=20 (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)))
(4 additional frame(s) were not displayed)
...
  File "pandora\openai\api.py", line 131, in list_conversations
    resp = self.session.get(url=url, headers=self.basic_headers, **self.req_kwargs)
  File "requests\sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
  File "requests\sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "requests\sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "requests\adapters.py", line 559, in send
    raise ProxyError(e, request=request)

The GPT token is a security risk to the program

When calling the api of GPT, it is not accessing the official api of openai, but the author's proxy domain (chat.gateway.do)
More information in the source code

self.basic_headers = {
'Authorization': 'Bearer ' + self.access_token,
'User-Agent': self.user_agent,
'Content-Type': 'application/json',
}
super().__init__(proxy, self.req_kwargs['verify'])
def list_models(self, raw=False):
url = 'https://chat.gateway.do/api/models'
resp = self.session.get(url=url, headers=self.basic_headers, **self.req_kwargs)

There is a risk of token leakage and the proxy middleware can easily capture the access_token of all calls to this interface

Please ask anyone using the interface to cancel the token and regenerate it, and hopefully the author will provide the option for users to decide whether to use your interface or not.

api 账号被封禁

使用了api key,使用了大概两分钟,没有使用代理。
This key is associated with a deactivated account. If you feel this is an error, contact us through our help center at help.openai.com.
An error occurred. If this issue persists please contact us through our help center at help.openai.com.

一点改进的想法

  1. 希望支持token或者账号信息保留
  2. 对于中文内容的输入,删除中文字符会出错:
    image
    这同时导致无法选择该chat
    image

为啥我的token还是无法登陆?

        Pandora - A command-line interface to ChatGPT
        Github: https://github.com/pengzhile/pandora
        Version: 0.2.9

Do you want to save your access token for the next login? [y/n] (n): y
### Error occurred: list conversations failed: <html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

nginx反代后开启ssl接口报错

image
14dca565897e431ab5ca8c6251b7e7c
大佬,使用nginx反代端口后开启ssl,页面一直访问http接口导致无法加载接口信息,有什么方法解决吗,期待大佬的回复,感谢!

InvalidVersion error

Hello I've been using this fantastic tools to connect to ChatGPT for a few days. However when I'm doing upgrade operation for it to version 0.6.3 I got this error:

pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '0.23ubuntu1' (package: distro-info)

How to solve this?

I'm using Ubuntu20.4 and python 3.8.10

Docker容器运行提示 Max retries exceeded with url

Docker 版本号: 20.10.21
docker build -t pandora . 构建成功

问题描述: 使用浏览器访问 chat.openai.com 是正常的, 通过 Docker 容器运行后提示 Max retries exceeded with url.

# docker run -it --rm pandora --token_file /opt/app/token.txt --proxy http://172.25.64.1:7890 -v

    Pandora - A command-line interface to ChatGPT
    Github: https://github.com/pengzhile/pandora

Do you want to save your access token for the next login? [y/n] (n): y

The access token has been saved to the file:
/root/.config/Pandora-ChatGPT/access_token.dat

Error occurred: HTTPSConnectionPool(host='apps.openai.com', port=443): Max retries exceeded with url:

/api/conversations?offset=0&limit=20 (Caused by ProxyError('Cannot connect to proxy.', OSError(0, 'Error')))
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3-1.26.14-py3.7.egg/urllib3/connectionpool.py", line 700, in urlopen
self.prepare_proxy(conn)
File "/usr/local/lib/python3.7/site-packages/urllib3-1.26.14-py3.7.egg/urllib3/connectionpool.py", line 996, in prepare_proxy
conn.connect()
File "/usr/local/lib/python3.7/site-packages/urllib3-1.26.14-py3.7.egg/urllib3/connection.py", line 424, in connect
tls_in_tls=tls_in_tls,
File "/usr/local/lib/python3.7/site-packages/urllib3-1.26.14-py3.7.egg/urllib3/util/ssl
.py", line 450, in ssl_wrap_socket
sock, context, tls_in_tls, server_hostname=server_hostname
File "/usr/local/lib/python3.7/site-packages/urllib3-1.26.14-py3.7.egg/urllib3/util/ssl
.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/local/lib/python3.7/ssl.py", line 423, in wrap_socket
session=session
File "/usr/local/lib/python3.7/ssl.py", line 870, in _create
self.do_handshake()
File "/usr/local/lib/python3.7/ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/requests-2.28.2-py3.7.egg/requests/adapters.py", line 499, in send
timeout=timeout,
File "/usr/local/lib/python3.7/site-packages/urllib3-1.26.14-py3.7.egg/urllib3/connectionpool.py", line 788, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.7/site-packages/urllib3-1.26.14-py3.7.egg/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='apps.openai.com', port=443): Max retries exceeded with url:
/api/conversations?offset=0&limit=20 (Caused by ProxyError('Cannot connect to proxy.', OSError(0, 'Error')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/Pandora_ChatGPT-0.1.2-py3.7.egg/pandora/launcher.py", line 129, in run
main()
File "/usr/local/lib/python3.7/site-packages/Pandora_ChatGPT-0.1.2-py3.7.egg/pandora/launcher.py", line 124, in main
ChatBot(ChatGPT(access_token, args.proxy)).run()
File "/usr/local/lib/python3.7/site-packages/Pandora_ChatGPT-0.1.2-py3.7.egg/pandora/openai/bot.py", line 39, in run
conversation_base = self.__choice_conversation()
File "/usr/local/lib/python3.7/site-packages/Pandora_ChatGPT-0.1.2-py3.7.egg/pandora/openai/bot.py", line 262, in
__choice_conversation
conversations = self.chatgpt.list_conversations((page - 1) * page_size, page_size)
File "/usr/local/lib/python3.7/site-packages/Pandora_ChatGPT-0.1.2-py3.7.egg/pandora/openai/api.py", line 44, in
list_conversations
resp = self.session.get(url=url, headers=self.basic_headers, allow_redirects=False, timeout=100)
File "/usr/local/lib/python3.7/site-packages/requests-2.28.2-py3.7.egg/requests/sessions.py", line 600, in get
return self.request("GET", url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests-2.28.2-py3.7.egg/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests-2.28.2-py3.7.egg/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests-2.28.2-py3.7.egg/requests/adapters.py", line 559, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='apps.openai.com', port=443): Max retries exceeded with url:
/api/conversations?offset=0&limit=20 (Caused by ProxyError('Cannot connect to proxy.', OSError(0, 'Error')))

Exception: list models failed: <html>

Sentry Issue: PANDORA-Y

Exception: list models failed: <html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

(1 additional frame(s) were not displayed)
...
  File "pandora\launcher.py", line 167, in main
    ChatBotLegacy(chatgpt).run()
  File "pandora\bots\legacy.py", line 45, in run
    self.__new_conversation()
  File "pandora\bots\legacy.py", line 171, in __new_conversation
    self.state = State(model_slug=self.__choice_model()['slug'])
  File "pandora\bots\legacy.py", line 403, in __choice_model
    models = self.chatgpt.list_models()
  File "pandora\openai\api.py", line 120, in list_models
    raise Exception('list models failed: ' + self.__get_error(resp))

偶然重命名标题失败

Version: 0.6.9, Mode: cli, Engine: free

  1. 偶然重命名标题失败,两次全新会话,内容一样,一次重命名失败,一次成功。

    ### Error occurred: gen title failed: Hmm...something seems to have gone wrong.
    Maybe try me again in a little bit.
    

pip安装运行报错

File "/usr/local/python3/tutorial-env/bin/pandora", line 33, in
sys.exit(load_entry_point('Pandora-ChatGPT==0.6.11', 'console_scripts', 'pandora')())
File "/usr/local/python3/tutorial-env/bin/pandora", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/local/python3/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/local/python3/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/usr/local/python3/tutorial-env/lib/python3.8/site-packages/pandora/launcher.py", line 28, in
readline.set_auto_history(False)
AttributeError: module 'readline' has no attribute 'set_auto_history'

有人碰到过吗,windows下可以,linux下就报上面的错

chat.gateway.do

image

请问一下 apps.openai.com 为什么换成 chat.gateway.do?
chat.gateway.do 服务有什么功能?这个服务是怎么部署的?

可以实现修改上一次的提问吗

网页端是可以修改提问然后重新生成的
比如提问内容有错字或者容易误解的内容之类的,可以进行修改然后重新生成回答

请问一下docker怎么更换默认的启动端口8008?

你好,我想在1个主机上面同时部署多个服务,需要映射不同端口,但我尝试 -e PANDORA_SERVER=0.0.0.0:8028 ... -p 8028:8008 这个启动命令,无法访问服务。只有映射默认的8008才好用。请问如何在一台机器上改不同实例的默认启动端口呢?

谷歌认证登录失败

1,我通过google 认证链接获取一个json信息, 放到 token 中,
2,然后运行docker run -it --rm pandora -t token
3,返回报错
image

选择界面重复的模型名称

Version: 0.6.9, Mode: cli, Engine: free

A saved access token has been detected. Do you want to use it? [y/n/del] (y):
Choice conversation (Page 1):
  1.    New chat
  t?.   Set title for the conversation, eg: t1
  d?.   Delete the conversation, eg: d1
  dd.   !! Clear all conversations
  r.    Refresh conversation list
  c.    ** Start new chat
Your choice: c
Choice model:
  1.    Turbo (Default for free users) - The standard ChatGPT model
  2.    Turbo (Default for free users) - The standard ChatGPT model
  r.    Refresh model list
Your choice: 1

pandora-tiktoken的版本问题

你好:
使用pip安装的时候,报错
" Could not find a version that satisfies the requirement pandora-tiktoken~=0.3.1 (from Pandora-ChatGPT==0.6.10) (from versions:)
No matching distribution found for pandora-tiktoken~=0.3.1 (from Pandora-ChatGPT==0.6.10)"
切换清华和阿里的源还是同样的报错,怎么解决呢?万分感谢

pandora命令不存在

我按照教程安装完成之后,在cmd命令行输入pandora,提示我‘不是内部或外部命令’,是需要在添加环境变量吗?如果需要添加该怎么加呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.