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

Implement OpenAI July 2023 Updates #427

Merged
merged 4 commits into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Implement OpenAI July 2023 Updates
  • Loading branch information
liushuangls committed Jul 7, 2023
commit eae5cc0d3bd055f053ae249bf0f158fc8b0ca31c
29 changes: 17 additions & 12 deletions completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,23 @@ const (
GPT3Dot5Turbo16K = "gpt-3.5-turbo-16k"
GPT3Dot5Turbo16K0613 = "gpt-3.5-turbo-16k-0613"
GPT3Dot5Turbo = "gpt-3.5-turbo"
GPT3TextDavinci003 = "text-davinci-003"
GPT3TextDavinci002 = "text-davinci-002"
GPT3TextCurie001 = "text-curie-001"
GPT3TextBabbage001 = "text-babbage-001"
GPT3TextAda001 = "text-ada-001"
GPT3TextDavinci001 = "text-davinci-001"
GPT3DavinciInstructBeta = "davinci-instruct-beta"
GPT3Davinci = "davinci"
GPT3CurieInstructBeta = "curie-instruct-beta"
GPT3Curie = "curie"
GPT3Ada = "ada"
GPT3Babbage = "babbage"
GPT3Dot5TurboInstruct = "gpt-3.5-turbo-instruct"
GPT3TextDavinci003 = "text-davinci-003" // Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
GPT3TextDavinci002 = "text-davinci-002" // Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
GPT3TextCurie001 = "text-curie-001" // Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
GPT3TextBabbage001 = "text-babbage-001" // Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
GPT3TextAda001 = "text-ada-001" // Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
GPT3TextDavinci001 = "text-davinci-001" // Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
GPT3DavinciInstructBeta = "davinci-instruct-beta" // Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
GPT3Davinci = "davinci" // Deprecated: Will be shut down on January 04, 2024. Use davinci-002 instead.
GPT3Davinci002 = "davinci-002"
GPT3CurieInstructBeta = "curie-instruct-beta" // Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
GPT3Curie = "curie" // Deprecated: Will be shut down on January 04, 2024. Use curie-002 instead.
GPT3Curie002 = "curie-002"
GPT3Ada = "ada" // Deprecated: Will be shut down on January 04, 2024. Use ada-002 instead.
GPT3Ada002 = "ada-002"
GPT3Babbage = "babbage" // Deprecated: Will be shut down on January 04, 2024. Use babbage-002 instead.
GPT3Babbage002 = "babbage-002"
)

// Codex Defines the models provided by OpenAI.
Expand Down
3 changes: 2 additions & 1 deletion edits.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ type EditsResponse struct {
Choices []EditsChoice `json:"choices"`
}

// Perform an API call to the Edits endpoint.
// Edits Perform an API call to the Edits endpoint.
// Deprecated: Users of the Edits API and its associated models (e.g., text-davinci-edit-001 or code-davinci-edit-001) will need to migrate to GPT-3.5 Turbo by January 4, 2024.
func (c *Client) Edits(ctx context.Context, request EditsRequest) (response EditsResponse, err error) {
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/edits", fmt.Sprint(request.Model)), withBody(request))
if err != nil {
Expand Down
34 changes: 17 additions & 17 deletions embeddings.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ func (e *EmbeddingModel) UnmarshalText(b []byte) error {
}

const (
Unknown EmbeddingModel = iota
AdaSimilarity
BabbageSimilarity
CurieSimilarity
DavinciSimilarity
AdaSearchDocument
AdaSearchQuery
BabbageSearchDocument
BabbageSearchQuery
CurieSearchDocument
CurieSearchQuery
DavinciSearchDocument
DavinciSearchQuery
AdaCodeSearchCode
AdaCodeSearchText
BabbageCodeSearchCode
BabbageCodeSearchText
Unknown EmbeddingModel = iota
AdaSimilarity // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
BabbageSimilarity // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
CurieSimilarity // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
DavinciSimilarity // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
AdaSearchDocument // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
AdaSearchQuery // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
BabbageSearchDocument // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
BabbageSearchQuery // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
CurieSearchDocument // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
CurieSearchQuery // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
DavinciSearchDocument // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
DavinciSearchQuery // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
AdaCodeSearchCode // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
AdaCodeSearchText // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
BabbageCodeSearchCode // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
BabbageCodeSearchText // Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
AdaEmbeddingV2
)

Expand Down