Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
Hello OpenAI Community!
I'm working on an asynchronous Telegram bot in Python, utilizing the OpenAI API for generating text with the GPT-3.5 Turbo model. The text generation part is functioning smoothly, however, I've encountered difficulties when trying to add the capability to generate images using DALL-E 3.
I'm using the latest version of the openai library (installed via !pip install --upgrade openai), but my attempts to use openai.Completion or any related methods for DALL-E result in the following error:
To Reproduce
ERROR:main:Error processing message:
You tried to access openai.Completion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.
You can run openai migrate to automatically upgrade your codebase to use the 1.0.0 interface.
Alternatively, you can pin your installation to the old version, e.g., pip install openai==0.28
A detailed migration guide is available here: #742
Code snippets
import openai
openai.api_key = 'my_openai_api_key'
# Example code that leads to the error
try:
response = openai.Completion.create(
engine="text-davinci-003",
prompt="This is a test prompt.",
temperature=0.7,
max_tokens=150
)
except Exception as e:
print(f"Encountered an error: {e}")
OS
Google Colab
Python version
3.10.12
Library version
1.14.1
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
Hello OpenAI Community!
I'm working on an asynchronous Telegram bot in Python, utilizing the OpenAI API for generating text with the GPT-3.5 Turbo model. The text generation part is functioning smoothly, however, I've encountered difficulties when trying to add the capability to generate images using DALL-E 3.
I'm using the latest version of the openai library (installed via !pip install --upgrade openai), but my attempts to use openai.Completion or any related methods for DALL-E result in the following error:
To Reproduce
ERROR:main:Error processing message:
You tried to access openai.Completion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.
You can run
openai migrateto automatically upgrade your codebase to use the 1.0.0 interface.Alternatively, you can pin your installation to the old version, e.g.,
pip install openai==0.28A detailed migration guide is available here: #742
Code snippets
OS
Google Colab
Python version
3.10.12
Library version
1.14.1