-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed as not planned
Closed as not planned
Copy link
Labels
questionFurther information is requestedFurther information is requested
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
I am getting You tried to access openai.ChatCompletion, 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 even with correct code response = openai.ChatCompletion.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": prompt}
],
max_tokens=500,
temperature=0.7
)
To Reproduce
run a python file calling openAi GPT-4 in Windows VS code
Code snippets
response = openai.ChatCompletion.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": prompt}
],
max_tokens=500,
temperature=0.7
)OS
Windows 11
Python version
Python 3.12.3
Library version
1.68.2
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested