Closed wuqi0457 closed 1 year ago
第一次见到这种异常,请提供一下完整的日志
第一次见到这种异常,请提供一下完整的日志
2023-03-09 12:41:55.802 | INFO | graia.ariadne.model:log:82 - 3392098749: [RECV][LYT(1002412109)] -> 切换AI bing-c 2023-03-09 12:41:55.808 | DEBUG | middlewares.concurrentlock:handle_request:46 - [Concurrent] 排队中<utils.QueueInfo object at 0x000001C773CBF130>,前面还有 0 个人! 2023-03-09 12:41:55.811 | DEBUG | middlewares.concurrentlock:handle_request:48 - [Concurrent] 排到了! 2023-03-09 12:41:56.248 | ERROR | __main__:request:211 - 'latin-1' codec can't encode characters in position 2327-2336: ordinal not in range(256) Traceback (most recent call last):
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\bot.py", line 325, in
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\graia\ariadne\app.py", line 312, in launch_blocking cls.launch_manager.launch_blocking(loop=cls.service.loop, stop_signal=stop_signals) │ │ │ │ │ │ └ (<Signals.SIGINT: 2>,) │ │ │ │ │ └ <property object at 0x000001C773398220> │ │ │ │ └ <graia.ariadne.service.ElizabethService object at 0x000001C769BB0E80> │ │ │ └ <class 'graia.ariadne.app.Ariadne'> │ │ └ <function Launart.launch_blocking at 0x000001C7730898B0> │ └ <launart.manager.Launart object at 0x000001C77478BD60> └ <class 'graia.ariadne.app.Ariadne'>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\launart\manager.py", line 494, in launch_blocking
loop.run_until_complete(launch_task)
│ │ └ <Task pending name='amnesia-launch' coro=<Launart.launch() running at F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt...
│ └ <function BaseEventLoop.run_until_complete at 0x000001C76B8C1820>
└
File "asyncio\base_events.py", line 634, in run_until_complete ', '.join(str(exc) for exc in exceptions))) └ <module 'asyncio.exceptions' from 'F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\python39.zip\asynci...
File "asyncio\windows_events.py", line 321, in run_forever
File "asyncio\base_events.py", line 601, in run_forever exc.errno, 'error while '
File "asyncio\base_events.py", line 1905, in _run_once
File "asyncio\events.py", line 80, in _run self._loop = loop │ └ <member '_loop' of 'Handle' objects> └ <Handle <TaskStepMethWrapper object at 0x000001C77475AC40>()>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\graia\broadcast__init__.py", line 191, in Executor result = await run_always_await(target_callable, **parameter_compile_result) │ │ └ {'app': <graia.ariadne.app.Ariadne object at 0x000001C769BDD220>, 'friend': Friend(id=1002412109, nickname='LYT', remark='LYT... │ └ <function friend_message_listener at 0x000001C773EA9D30> └ <function run_always_await at 0x000001C773095C10>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\graia\broadcast\utilles.py", line 34, in run_always_await obj = await obj └ <coroutine object friend_message_listener at 0x000001C773CB6D40>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\bot.py", line 231, in friend_message_listener await handle_message(friend, f"friend-{friend.id}", chain.display, source, chain) │ │ │ │ │ └ MessageChain([Plain(text='切换AI bing-c')]) │ │ │ │ └ Source(id=3407, time=datetime.datetime(2023, 3, 9, 4, 41, 55, tzinfo=datetime.timezone.utc), type='Source') │ │ │ └ <property object at 0x000001C7732AD2C0> │ │ └ MessageChain([Plain(text='切换AI bing-c')]) │ └ Friend(id=1002412109, nickname='LYT', remark='LYT') └ <function handle_message at 0x000001C773EA9C10>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\bot.py", line 219, in handle_message
await action(session_id, source, target, message.strip(), conversation_context, respond)
│ │ │ │ │ │ │ └ <function handle_message.
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\bot.py", line 111, in call
await m.handle_request(session_id, source, target, message, respond, conversation_context, n)
│ │ │ │ │ │ │ │ └ <function handle_message.
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\middlewares\concurrentlock.py", line 49, in handle_request
await action(session_id, source, target, prompt, conversation_context, respond)
│ │ │ │ │ │ └ <function handle_message.
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\bot.py", line 111, in call
await m.handle_request(session_id, source, target, message, respond, conversation_context, n)
│ │ │ │ │ │ │ │ └ <function handle_message.
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\middlewares\middleware.py", line 10, in handle_request
await action(session_id, source, target, prompt, conversation_context, respond)
│ │ │ │ │ │ └ <function handle_message.
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\bot.py", line 111, in call
await m.handle_request(session_id, source, target, message, respond, conversation_context, n)
│ │ │ │ │ │ │ │ └ <function handle_message.
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\middlewares\ratelimit.py", line 24, in handle_request
await action(session_id, source, target, prompt, conversation_context, respond)
│ │ │ │ │ │ └ <function handle_message.
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\bot.py", line 111, in call
await m.handle_request(session_id, source, target, message, respond, conversation_context, n)
│ │ │ │ │ │ │ │ └ <function handle_message.
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\middlewares\timeout.py", line 32, in handle_request
await action(session_id, source, target, prompt, conversation_context, respond)
│ │ │ │ │ │ └ <function handle_message.
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\bot.py", line 134, in request conversation_handler.current_conversation = await conversation_handler.create( │ │ │ └ <function ConversationHandler.create at 0x000001C7747C58B0> │ │ └ <conversation.ConversationHandler object at 0x000001C77474AAC0> │ └ <conversation.ConversationContext object at 0x000001C77474ABB0> └ <conversation.ConversationHandler object at 0x000001C77474AAC0>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\conversation.py", line 153, in create conversation = ConversationContext(_type, self.session_id) │ │ │ └ 'friend-1002412109' │ │ └ <conversation.ConversationHandler object at 0x000001C77474AAC0> │ └ 'bing-c' └ <class 'conversation.ConversationContext'>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\conversation.py", line 47, in init self.adapter = BingAdapter(self.session_id, ConversationStyle.creative) │ │ │ │ │ └ <ConversationStyle.creative: 'h3imaginative'> │ │ │ │ └ <enum 'ConversationStyle'> │ │ │ └ 'friend-1002412109' │ │ └ <conversation.ConversationContext object at 0x000001C773CBFA30> │ └ <class 'adapter.ms.bing.BingAdapter'> └ <conversation.ConversationContext object at 0x000001C773CBFA30>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\adapter\ms\bing.py", line 34, in init self.bot = EdgeChatbot(cookies=self.cookieData) │ │ │ └ [{'name': 'MUID', 'value': '051E75E4939B6DAA1A91674992426CA3'}, {'name': 'MUIDB', 'value': '051E75E4939B6DAA1A91674992426CA3'... │ │ └ <adapter.ms.bing.BingAdapter object at 0x000001C773CD1340> │ └ <class 'EdgeGPT.Chatbot'> └ <adapter.ms.bing.BingAdapter object at 0x000001C773CD1340>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\EdgeGPT.py", line 269, in init self.chat_hub: ChatHub = ChatHub(Conversation(self.cookiePath, self.cookies)) │ │ │ │ │ │ └ [{'name': 'MUID', 'value': '051E75E4939B6DAA1A91674992426CA3'}, {'name': 'MUIDB', 'value': '051E75E4939B6DAA1A91674992426CA3'... │ │ │ │ │ └ <EdgeGPT.Chatbot object at 0x000001C773CD1310> │ │ │ │ └ '' │ │ │ └ <EdgeGPT.Chatbot object at 0x000001C773CD1310> │ │ └ <class 'EdgeGPT.Conversation'> │ └ <class 'EdgeGPT.ChatHub'> └ <EdgeGPT.Chatbot object at 0x000001C773CD1310>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\EdgeGPT.py", line 178, in init response = self.session.get( │ │ └ <function Session.get at 0x000001C76C486280> │ └ <requests.sessions.Session object at 0x000001C773CD1430> └ <EdgeGPT.Conversation object at 0x000001C773CD13A0>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\requests\sessions.py", line 600, in get return self.request("GET", url, **kwargs) │ │ │ └ {'timeout': 30, 'headers': {'accept': 'application/json', 'accept-language': 'en-US,en;q=0.9', 'content-type': 'application/j... │ │ └ 'https://edgeservices.bing.com/edgesvc/turing/conversation/create' │ └ <function Session.request at 0x000001C76C4861F0> └ <requests.sessions.Session object at 0x000001C773CD1430>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\requests\sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) │ │ │ └ {'timeout': 30, 'allow_redirects': True, 'proxies': OrderedDict([('http', 'http://127.0.0.1:7890'), ('https', 'http://127.0.0... │ │ └ <PreparedRequest [GET]> │ └ <function Session.send at 0x000001C76C486670> └ <requests.sessions.Session object at 0x000001C773CD1430>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\requests\sessions.py", line 701, in send r = adapter.send(request, **kwargs) │ │ │ └ {'timeout': 30, 'proxies': OrderedDict([('http', 'http://127.0.0.1:7890'), ('https', 'http://127.0.0.1:7890'), ('ftp', 'http:... │ │ └ <PreparedRequest [GET]> │ └ <function HTTPAdapter.send at 0x000001C76C494AF0> └ <requests.adapters.HTTPAdapter object at 0x000001C773CD15E0>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\requests\adapters.py", line 489, in send resp = conn.urlopen( │ └ <function HTTPConnectionPool.urlopen at 0x000001C76C37FA60> └ <urllib3.connectionpool.HTTPSConnectionPool object at 0x000001C773CD1E80>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen httplib_response = self._make_request( │ └ <function HTTPConnectionPool._make_request at 0x000001C76C37F820> └ <urllib3.connectionpool.HTTPSConnectionPool object at 0x000001C773CD1E80>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\urllib3\connectionpool.py", line 398, in _make_request conn.request(method, url, **httplib_request_kw) │ │ │ │ └ {'body': None, 'headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Ch... │ │ │ └ '/edgesvc/turing/conversation/create' │ │ └ 'GET' │ └ <function HTTPConnection.request at 0x000001C76C3A1310> └ <urllib3.connection.HTTPSConnection object at 0x000001C773CDA070>
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\urllib3\connection.py", line 239, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) │ │ │ │ │ └ {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.... │ │ │ │ └ None │ │ │ └ '/edgesvc/turing/conversation/create' │ │ └ 'GET' │ └ <urllib3.connection.HTTPSConnection object at 0x000001C773CDA070> └ <class 'urllib3.connection.HTTPConnection'>
File "http\client.py", line 1285, in request
File "http\client.py", line 1326, in _send_request
File "F:\chatgpt\Windows-quickstart-refs.tags.v2.2.1\chatgpt\python3.9\lib\site-packages\urllib3\connection.py", line 224, in putheader _HTTPConnection.putheader(self, header, *values) │ │ │ │ └ ('ABDEF=V=13&ABDV=13&MRNB=1677410067619&MRB=0; ANIMIA=FRE=1; ANON=A=A4BF388A624DF49FCA8A69D1FFFFFFFF&E=1c11&W=1; KievRPSSecAu... │ │ │ └ 'Cookie' │ │ └ <urllib3.connection.HTTPSConnection object at 0x000001C773CDA070> │ └ <function HTTPConnection.putheader at 0x000001C76C0040D0> └ <class 'http.client.HTTPConnection'>
File "http\client.py", line 1258, in putheader
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 2327-2336: ordinal not in range(256) 2023-03-09 12:41:56.833 | DEBUG | middlewares.timeout:create_timeout_task:14 - [Timeout] 开始计时…… 2023-03-09 12:41:57.023 | INFO | graia.ariadne.model:log:82 - 3392098749: [SEND][LYT(1002412109)] <- 出现故障!如果 这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚对话” 来回溯到上一条对话,你上一条说的我就当 作没看见。 2023-03-09 12:41:57.029 | DEBUG | middlewares.timeout:on_respond:42 - [Timeout] 取消计时……
这可能是因为你的 Cookie 中有汉字导致的,你可以试试看把那断有汉字的 Cookie 删除再试试。
一段 Cookie 由 ;
结尾。 例如: 在 ABDEF=V=13&ABDV=13&MRNB=1677410067619&MRB=0; ANIMIA=FRE=1;
中,ANIMIA=FRE=1;
就是一段 Cookie。
这可能是因为你的 Cookie 中有汉字导致的,你可以试试看把那断有汉字的 Cookie 删除再试试。 一段 Cookie 由
;
结尾。 例如: 在ABDEF=V=13&ABDV=13&MRNB=1677410067619&MRB=0; ANIMIA=FRE=1;
中,ANIMIA=FRE=1;
就是一段 Cookie。
好的,已成功,非常感谢
提交 issue 前,请先确认:
表现
切换new bing时报错
运行环境:
复现步骤
配置好config文件时,启动chatgpt.cmd,能够正常使用chatgpt-api版,但无法切换成new bing版
截图
配置文件关于bing账号设置如下
chatgpt.cmd启动界面如下
向机器人提出切换AI命令
chatgpt.cmd错误原因
请求
请问是哪里弄错了,我在网页上能正常使用new bing聊天