Closed SmartManoj closed 4 weeks ago
Thanks for the PR, why do you want to pass an integer?
Thank you for the quick review. The reason I proposed allowing integers is for flexibility and convenience. In some cases, users might inadvertently pass an integer like 0 or 1 instead of a boolean. Converting these values internally ensures smooth operation without errors, improving the overall user experience.
Currently if passed 0 for model openai/nvidia/llama-3.1-nemotron-70b-instruct
, got openai.InternalServerError: failed to decode json body: json: bool unexpected end of JSON input
Thanks for the PR but I don't think we want to support int
here, we try to match what the API supports. I agree the error in that case could be improved, it should be a 400 instead of a 500, I've reported this to the OpenAI API team.
Update
client.chat.completions.create
to convertstream
parameter to boolean if it is an integer.Completions class:
stream
parameter type toUnion[bool, int]
.stream
to boolean if it is an integer before passing to_post
method.AsyncCompletions class:
stream
parameter type toUnion[bool, int]
.stream
to boolean if it is an integer before passing to_post
method.For more details, open the Copilot Workspace session.