Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Owner

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!

default:
err = ErrChatCompletionInvalidModel
return
}
Expand Down
7 changes: 6 additions & 1 deletion completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ var (
// GPT3 Models are designed for text-based tasks. For code-specific
// tasks, please refer to the Codex series of models.
const (
GPT432K0314 = "gpt-4-32k-0314"
GPT432K = "gpt-4-32k"
GPT40314 = "gpt-4-0314"
GPT4 = "gpt-4"
GPT3Dot5Turbo0301 = "gpt-3.5-turbo-0301"
GPT3Dot5Turbo = "gpt-3.5-turbo"
GPT3TextDavinci003 = "text-davinci-003"
Expand Down Expand Up @@ -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:
Copy link
Owner

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?

Copy link
Contributor Author

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

Copy link
Owner

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.

err = ErrCompletionUnsupportedModel
return
}
Expand Down