Closed fgmacedo closed 3 weeks ago
What mypy version are you using? I can't reproduce on 1.11.1
.
Regardless, this is not a bug in the library. The total=False
keyword argument in the class definition means that all fields that don't use the Required
type can be omitted.
Please report a bug with mypy if this continues to fail for you.
Hi @RobertCraigie , thanks for your fast reply. I'm using the same mypy version. Ok, now I see the total=False
... I don't know what's going on to make mypy sad. I'll skip the linter for this line. Best regards!
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
The class param
ChatCompletionSystemMessageParam.name
is described as being optional, in fact, the API works without issues if we don't pass this param. But the type is not marked as optional. (Same issue withChatCompletionUserMessageParam.name
andChatCompletionAssistantMessageParam.name
).Instead of being declared as
It should be declared as:
To Reproduce
Given this test file:
Run:
Output:
Code snippets
No response
OS
ubuntu
Python version
Python 3.12.2
Library version
openai 1.42.0