openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

Set "$. messages [0] (SystemMessage). content (ArrayOfContentParts)" as an empty list, and no 400 is returned

Open steadyfirmness opened this issue 1 year ago • 1 comments

Describe the bug

It is mentioned in the official openapi document (https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-f9320ebf347140052c7f8b0bc5c7db24f5e367c368c8cb34c3606af4e2b6591b.yml) image

To Reproduce

1.I made the following request with empty list 2.response said 200 but not 400

I think this is inconsistent with the description in the document

Code snippets

completion = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {
            "content": [],
            "role": "system"
        },
        {
            "content": "hello",
            "role": "user"
        }
    ])

OS

macOS

Python version

Python v3.12.4

Library version

openai v1.50.2

steadyfirmness avatar Oct 23 '24 09:10 steadyfirmness

whats more, other "ArrayOfContent" have this issue too.

steadyfirmness avatar Oct 23 '24 09:10 steadyfirmness