Skip to content

import openai openai.error.InvalidRequestError: Invalid URL (POST /v1/chat/completions) #271

@Eric0101

Description

@Eric0101

Describe the bug

[ERROR][2023-03-04 18:25:20][chat_gpt_bot.py:68] - Invalid URL (POST /v1/chat/completions)
Traceback (most recent call last):
File "/opt/chatgpt-on-wechat/bot/chatgpt/chat_gpt_bot.py", line 44, in reply_text
response = openai.ChatCompletion.create(
File "/usr/local/lib/python3.9/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/usr/local/lib/python3.9/site-packages/openai/api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "/usr/local/lib/python3.9/site-packages/openai/api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "/usr/local/lib/python3.9/site-packages/openai/api_requestor.py", line 679, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: Invalid URL (POST /v1/chat/completions)

To Reproduce

response = openai.ChatCompletion.create(

openai.error.InvalidRequestError: Invalid URL (POST /v1/chat/completions)

Code snippets

response = openai.ChatCompletion.create(

openai.error.InvalidRequestError: Invalid URL (POST /v1/chat/completions)


[root@vps87388579 chatgpt-on-wechat]# pip3 show openai
Name: openai
Version: 0.27.0
Summary: Python client library for the OpenAI API
Home-page: https://github.com/openai/openai-python
Author: OpenAI
Author-email: support@openai.com
License: None
Location: /usr/local/lib/python3.9/site-packages
Requires: requests, aiohttp, tqdm
Required-by:

OS

centos 8.6

Python version

3.9

Library version

0.27

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions