openai-python
openai-python copied to clipboard
Why do we get a `openai.error.InvalidRequestError` if we pass `None` to `logit_bias` even if it defaults to `null`?
Describe the bug
According to the docs, logit_bias
defaults to null
, but if we pass None
to this parameter we get openai.error.InvalidRequestError
openai.error.InvalidRequestError: None is not of type 'object' - 'logit_bias'
So, I suppose this is a bug in this package, as None
should correspond to what the docs refer to as null
, or the documentation is wrong.
To Reproduce
Use the script below
Code snippets
import openai
completions = openai.Completion.create(model="text-davinci-003",
prompt="hello",
logit_bias=None)
print(completions)
OS
macos monterey (12.5.1)
Python version
Python 3.8.13
Library version
0.27.0