Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This old format doesn;t supported anymore #1510

Open
1 task done
lucasjinreal opened this issue Jun 29, 2024 · 1 comment
Open
1 task done

This old format doesn;t supported anymore #1510

lucasjinreal opened this issue Jun 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@lucasjinreal
Copy link

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

response = client.chat.completions.create(
# model="alibaba/Qwen1.5-110B-Chat",
model="Qwen/Qwen2-7B-Instruct",
messages=[
{
"role": "system",
"content": [{"type": "text", "text": "you are a dog"}],
"name": "",
},
{
"role": "user",
"content": [{"type": "text", "text": "你好啊"}],
"name": "",
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "你好,我是一条狗,我叫汪昂",
}
],
"name": "",
},
{
"role": "user",
"content": [{"type": "text", "text": "Hello"}],
"name": "",
},
],
stream=True,
)

Am using openai to create, got request format error:

openai.BadRequestError: Error code: 400 - {'code': 50400, 'message': 'The request parameter is invalid, Please check again.', 'data': None, 'error': 'The request parameter is invalid, Please check again.'}

this format previous works OK> why?

To Reproduce

gyiguy

Code snippets

No response

OS

macOS

Python version

3.11

Library version

openai latest

@lucasjinreal lucasjinreal added the bug Something isn't working label Jun 29, 2024
@mophilly
Copy link

mophilly commented Jul 2, 2024

I also ran into this. python replied with "You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0" Now that is true in the form of the code below, but I also got the similar error using the client.chat.completions.create form.

Code snippet
response = openai.ChatCompletion.create( model="gpt-4", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": prompt} ], max_tokens=1000, temperature=0.7, )

OS
MacOS Sonoma (14.5)

Python Version
Python 3.12

Library version
openai v1.35.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants