Closed Jerry-155 closed 1 year ago
@Jerry-155 The error message you're getting states that an InvalidRequestError occurred due to an "Invalid URL" for the POST request /chat/completions.
There could be a number of reasons why this might be happening. Here are a few possibilities:
pip install -r requirements.txt
Search for answers in existing issues
Python version
python 3.10
Issue description
[INFO][2023-08-02 18:10:21][wechat.py:90] - message received: Message(room_id=No ne, sender_id=wxid_lb4k1t5gx3e722, sender_name=张昊, receiver_id=wxid_dv4222eb61 mi22, receiver_name=Jerry, content=bot 你好, type=1, is_group=False, create_time =2023-08-02 18:10:21, is_at=False) [INFO][2023-08-02 18:10:22][chatgpt.py:26] - [ChatGPTBot] Query=你好 [ERROR][2023-08-02 18:10:27][chatgpt.py:82] - [ChatGPTBot] Exception: Invalid UR L (POST /chat/completions) Traceback (most recent call last): File "E:\test1\wechat\bot\chatgpt.py", line 53, in reply_text response = openai.ChatCompletion.create( File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site- packages\openai\api_resources\chat_completion.py", line 25, in create return super().create(*args, **kwargs) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site- packages\openai\api_resources\abstract\engine_apiresource.py", line 153, in cre ate response, , api_key = requestor.request( File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site- packages\openai\api_requestor.py", line 298, in request resp, got_stream = self._interpret_response(result, stream) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site- packages\openai\api_requestor.py", line 700, in _interpret_response self._interpret_response_line( File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site- packages\openai\api_requestor.py", line 763, in _interpret_response_line raise self.handle_error_response( openai.error.InvalidRequestError: Invalid URL (POST /chat/completions)
Repro steps
No response
Relevant log output
No response