Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gburt
Copy link
Contributor

@gburt gburt commented Jan 17, 2025

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

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.58%. Comparing base (774fc9d) to head (1192948).
Report is 78 commits behind head on master.

Files with missing lines Patch % Lines
common.go 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #922      +/-   ##
==========================================
+ Coverage   98.46%   98.58%   +0.12%     
==========================================
  Files          24       27       +3     
  Lines        1364     1765     +401     
==========================================
+ Hits         1343     1740     +397     
- Misses         15       18       +3     
- Partials        6        7       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

omitempty option of request struct will generate incorrect request when parameter is 0.
1 participant