-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for GPT-4-32K and GPT-4-32K-0314 models #158
Conversation
Codecov Report
@@ Coverage Diff @@
## master #158 +/- ##
==========================================
+ Coverage 50.19% 50.48% +0.28%
==========================================
Files 16 16
Lines 516 517 +1
==========================================
+ Hits 259 261 +2
Misses 201 201
+ Partials 56 55 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -97,7 +101,8 @@ func (c *Client) CreateCompletion( | |||
ctx context.Context, | |||
request CompletionRequest, | |||
) (response CompletionResponse, err error) { | |||
if request.Model == GPT3Dot5Turbo0301 || request.Model == GPT3Dot5Turbo { | |||
switch request.Model { | |||
case GPT3Dot5Turbo0301, GPT3Dot5Turbo, GPT4, GPT40314, GPT432K0314, GPT432K: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that GPT4 is not available for the CreateCompletion
endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am uncertain at this time as my account does not yet have the necessary permissions to use the new GPT-4 API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks! I appreciate the effort to keep the API less brittle — let's wait a bit until we know these limitations for sure.
We can either keep this PR open or close it until next time.
@@ -68,7 +68,9 @@ func (c *Client) CreateChatCompletion( | |||
request ChatCompletionRequest, | |||
) (response ChatCompletionResponse, err error) { | |||
model := request.Model | |||
if model != GPT3Dot5Turbo0301 && model != GPT3Dot5Turbo { | |||
switch model { | |||
case GPT3Dot5Turbo0301, GPT3Dot5Turbo, GPT4, GPT40314, GPT432K0314, GPT432K: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is useful though, let's remove the other switch and merge!
* add chat gpt4 model support (#158) * remove check for gpt4 for CreateCompletion * test for model check --------- Co-authored-by: aeieli <aeliieli@gmail.com>
This PR adds support for the GPT-4-32K and GPT-4-32K-0314 models by adding three new constants to the list of GPT models and adding the new models to the switch statements in the CreateChatCompletion and CreateCompletion functions. The PR also removes unnecessary code that checked for invalid models, as the new models are valid. The changes in this PR do not introduce any new issues and successfully add support for the new models.
Changes Made:
Added three new constants for GPT-4-32K and GPT-4-32K-0314 models
Added new models to switch statements in CreateChatCompletion and CreateCompletion functions
Removed unnecessary code that checked for invalid models