openai-python
openai-python copied to clipboard
Use kwargs
Related to https://github.com/openai/openai-python/issues/231
When Completion is incorrectly used, the error suggests an bug in the codebase:
openai.api_key = "openai-key"
id_ = "cmpl-id"
result = openai.Completion.retrieve(id_chat)
# EngineAPIResource.init() takes from 1 to 2 positional arguments but 3 are given
With kwargs used, the params are passed correctly and a clearer error is thrown:
# InvalidRequestError: Invalid URL (GET /v1/completions/cmpl-id)