Skip to content

Commit 7b22898

Browse files
authored
Implement OpenAI July 2023 Updates (#427)
* Implement OpenAI July 2023 Updates * fix: golangci-lint * add comment * fix: remove some model Deprecated
1 parent 619ad71 commit 7b22898

File tree

3 files changed

+55
-22
lines changed

3 files changed

+55
-22
lines changed

completion.go

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,42 @@ var (
1717
// GPT3 Models are designed for text-based tasks. For code-specific
1818
// tasks, please refer to the Codex series of models.
1919
const (
20-
GPT432K0613 = "gpt-4-32k-0613"
21-
GPT432K0314 = "gpt-4-32k-0314"
22-
GPT432K = "gpt-4-32k"
23-
GPT40613 = "gpt-4-0613"
24-
GPT40314 = "gpt-4-0314"
25-
GPT4 = "gpt-4"
26-
GPT3Dot5Turbo0613 = "gpt-3.5-turbo-0613"
27-
GPT3Dot5Turbo0301 = "gpt-3.5-turbo-0301"
28-
GPT3Dot5Turbo16K = "gpt-3.5-turbo-16k"
29-
GPT3Dot5Turbo16K0613 = "gpt-3.5-turbo-16k-0613"
30-
GPT3Dot5Turbo = "gpt-3.5-turbo"
31-
GPT3TextDavinci003 = "text-davinci-003"
32-
GPT3TextDavinci002 = "text-davinci-002"
33-
GPT3TextCurie001 = "text-curie-001"
34-
GPT3TextBabbage001 = "text-babbage-001"
35-
GPT3TextAda001 = "text-ada-001"
36-
GPT3TextDavinci001 = "text-davinci-001"
20+
GPT432K0613 = "gpt-4-32k-0613"
21+
GPT432K0314 = "gpt-4-32k-0314"
22+
GPT432K = "gpt-4-32k"
23+
GPT40613 = "gpt-4-0613"
24+
GPT40314 = "gpt-4-0314"
25+
GPT4 = "gpt-4"
26+
GPT3Dot5Turbo0613 = "gpt-3.5-turbo-0613"
27+
GPT3Dot5Turbo0301 = "gpt-3.5-turbo-0301"
28+
GPT3Dot5Turbo16K = "gpt-3.5-turbo-16k"
29+
GPT3Dot5Turbo16K0613 = "gpt-3.5-turbo-16k-0613"
30+
GPT3Dot5Turbo = "gpt-3.5-turbo"
31+
GPT3Dot5TurboInstruct = "gpt-3.5-turbo-instruct"
32+
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
33+
GPT3TextDavinci003 = "text-davinci-003"
34+
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
35+
GPT3TextDavinci002 = "text-davinci-002"
36+
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
37+
GPT3TextCurie001 = "text-curie-001"
38+
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
39+
GPT3TextBabbage001 = "text-babbage-001"
40+
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
41+
GPT3TextAda001 = "text-ada-001"
42+
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
43+
GPT3TextDavinci001 = "text-davinci-001"
44+
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
3745
GPT3DavinciInstructBeta = "davinci-instruct-beta"
3846
GPT3Davinci = "davinci"
39-
GPT3CurieInstructBeta = "curie-instruct-beta"
40-
GPT3Curie = "curie"
41-
GPT3Ada = "ada"
42-
GPT3Babbage = "babbage"
47+
GPT3Davinci002 = "davinci-002"
48+
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
49+
GPT3CurieInstructBeta = "curie-instruct-beta"
50+
GPT3Curie = "curie"
51+
GPT3Curie002 = "curie-002"
52+
GPT3Ada = "ada"
53+
GPT3Ada002 = "ada-002"
54+
GPT3Babbage = "babbage"
55+
GPT3Babbage002 = "babbage-002"
4356
)
4457

4558
// Codex Defines the models provided by OpenAI.

edits.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ type EditsResponse struct {
3030
Choices []EditsChoice `json:"choices"`
3131
}
3232

33-
// Perform an API call to the Edits endpoint.
33+
// Edits Perform an API call to the Edits endpoint.
34+
/* Deprecated: Users of the Edits API and its associated models (e.g., text-davinci-edit-001 or code-davinci-edit-001)
35+
will need to migrate to GPT-3.5 Turbo by January 4, 2024.
36+
You can use CreateChatCompletion or CreateChatCompletionStream instead.
37+
*/
3438
func (c *Client) Edits(ctx context.Context, request EditsRequest) (response EditsResponse, err error) {
3539
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/edits", fmt.Sprint(request.Model)), withBody(request))
3640
if err != nil {

embeddings.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,37 @@ func (e *EmbeddingModel) UnmarshalText(b []byte) error {
3434

3535
const (
3636
Unknown EmbeddingModel = iota
37+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
3738
AdaSimilarity
39+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
3840
BabbageSimilarity
41+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
3942
CurieSimilarity
43+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
4044
DavinciSimilarity
45+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
4146
AdaSearchDocument
47+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
4248
AdaSearchQuery
49+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
4350
BabbageSearchDocument
51+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
4452
BabbageSearchQuery
53+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
4554
CurieSearchDocument
55+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
4656
CurieSearchQuery
57+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
4758
DavinciSearchDocument
59+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
4860
DavinciSearchQuery
61+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
4962
AdaCodeSearchCode
63+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
5064
AdaCodeSearchText
65+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
5166
BabbageCodeSearchCode
67+
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
5268
BabbageCodeSearchText
5369
AdaEmbeddingV2
5470
)

0 commit comments

Comments
 (0)