wwwzhouhui / Claude2-PyAPI

一个使用python 实现Claude2 创建会话、聊天、发送附件、获取历史会话,清理历史记录等功能的api接口,可以对接第三方系统作为二次开发使用。
MIT License
305 stars 49 forks source link

HTTP/2 stream 1 was not closed cleanly before end of the underlying stream #22

Open xfd997700 opened 9 months ago

xfd997700 commented 9 months ago

带附件请求总是会遇到这个问题,不带附件偶尔遇到,请问有没有解决方案 Traceback (most recent call last):

File ~\anaconda3\envs\compe\lib\site-packages\curl_cffi\requests\session.py:436 in request c.perform()

File ~\anaconda3\envs\compe\lib\site-packages\curl_cffi\curl.py:191 in perform self._check_error(ret, action="perform")

File ~\anaconda3\envs\compe\lib\site-packages\curl_cffi\curl.py:84 in _check_error raise error

CurlError: Failed to perform, ErrCode: 92, Reason: 'HTTP/2 stream 1 was not closed cleanly before end of the underlying stream'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File ~\anaconda3\envs\compe\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals)

File e:\repositories\claude2\test.py:49 response = claude_api.send_message(prompt, conversation_id)

File E:\Repositories\claude2\Claude2-PyAPI\claude_api.py:146 in send_message response = self.send_request("POST",url,headers=headers, data=payload, stream=True)

File E:\Repositories\claude2\Claude2-PyAPI\claude_api.py:344 in send_request return requests.request(method, url, headers=headers, data=data, files=files, params=params,impersonate="chrome110",timeout=500)

File ~\anaconda3\envs\compe\lib\site-packages\curl_cffi\requests__init__.py:46 in request return s.request(

File ~\anaconda3\envs\compe\lib\site-packages\curl_cffi\requests\session.py:438 in request raise RequestsError(e)

RequestsError: Failed to perform, ErrCode: 92, Reason: 'HTTP/2 stream 1 was not closed cleanly before end of the underlying stream'

wwwzhouhui commented 9 months ago

这个感觉想流没有关闭导致