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

[BREAKING_CHANGES] Make temperature nullable so that it can be set to 0

Open gburt opened this issue 9 months ago • 1 comments

For the Chat and Completions APIs make the Temperature field a *float32 so we can distinguish between 0 and null. Users often want to set the temperature to 0, but right now that's not possible because then the temperature field is omitempty'd from the JSON request object.

Other numeric parameters already default to 0 or have 0 as a nonsensical value, so this is only needed, AFAICT, for these two params.

This is an API break, but I think it's one worth making. We've been unintentionally running queries at the default temp (1) when we meant to be running it at 0.

Fixes #9

gburt avatar Jan 17 '25 19:01 gburt