Implement OpenAI July 2023 Updates (#427)
* Implement OpenAI July 2023 Updates * fix: golangci-lint * add comment * fix: remove some model Deprecated
This commit is contained in:
@@ -28,18 +28,31 @@ const (
|
|||||||
GPT3Dot5Turbo16K = "gpt-3.5-turbo-16k"
|
GPT3Dot5Turbo16K = "gpt-3.5-turbo-16k"
|
||||||
GPT3Dot5Turbo16K0613 = "gpt-3.5-turbo-16k-0613"
|
GPT3Dot5Turbo16K0613 = "gpt-3.5-turbo-16k-0613"
|
||||||
GPT3Dot5Turbo = "gpt-3.5-turbo"
|
GPT3Dot5Turbo = "gpt-3.5-turbo"
|
||||||
|
GPT3Dot5TurboInstruct = "gpt-3.5-turbo-instruct"
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
|
||||||
GPT3TextDavinci003 = "text-davinci-003"
|
GPT3TextDavinci003 = "text-davinci-003"
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
|
||||||
GPT3TextDavinci002 = "text-davinci-002"
|
GPT3TextDavinci002 = "text-davinci-002"
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
|
||||||
GPT3TextCurie001 = "text-curie-001"
|
GPT3TextCurie001 = "text-curie-001"
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
|
||||||
GPT3TextBabbage001 = "text-babbage-001"
|
GPT3TextBabbage001 = "text-babbage-001"
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
|
||||||
GPT3TextAda001 = "text-ada-001"
|
GPT3TextAda001 = "text-ada-001"
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
|
||||||
GPT3TextDavinci001 = "text-davinci-001"
|
GPT3TextDavinci001 = "text-davinci-001"
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
|
||||||
GPT3DavinciInstructBeta = "davinci-instruct-beta"
|
GPT3DavinciInstructBeta = "davinci-instruct-beta"
|
||||||
GPT3Davinci = "davinci"
|
GPT3Davinci = "davinci"
|
||||||
|
GPT3Davinci002 = "davinci-002"
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use gpt-3.5-turbo-instruct instead.
|
||||||
GPT3CurieInstructBeta = "curie-instruct-beta"
|
GPT3CurieInstructBeta = "curie-instruct-beta"
|
||||||
GPT3Curie = "curie"
|
GPT3Curie = "curie"
|
||||||
|
GPT3Curie002 = "curie-002"
|
||||||
GPT3Ada = "ada"
|
GPT3Ada = "ada"
|
||||||
|
GPT3Ada002 = "ada-002"
|
||||||
GPT3Babbage = "babbage"
|
GPT3Babbage = "babbage"
|
||||||
|
GPT3Babbage002 = "babbage-002"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Codex Defines the models provided by OpenAI.
|
// Codex Defines the models provided by OpenAI.
|
||||||
|
|||||||
6
edits.go
6
edits.go
@@ -30,7 +30,11 @@ type EditsResponse struct {
|
|||||||
Choices []EditsChoice `json:"choices"`
|
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.
|
||||||
|
You can use CreateChatCompletion or CreateChatCompletionStream instead.
|
||||||
|
*/
|
||||||
func (c *Client) Edits(ctx context.Context, request EditsRequest) (response EditsResponse, err error) {
|
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))
|
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/edits", fmt.Sprint(request.Model)), withBody(request))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -34,21 +34,37 @@ func (e *EmbeddingModel) UnmarshalText(b []byte) error {
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
Unknown EmbeddingModel = iota
|
Unknown EmbeddingModel = iota
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
AdaSimilarity
|
AdaSimilarity
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
BabbageSimilarity
|
BabbageSimilarity
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
CurieSimilarity
|
CurieSimilarity
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
DavinciSimilarity
|
DavinciSimilarity
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
AdaSearchDocument
|
AdaSearchDocument
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
AdaSearchQuery
|
AdaSearchQuery
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
BabbageSearchDocument
|
BabbageSearchDocument
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
BabbageSearchQuery
|
BabbageSearchQuery
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
CurieSearchDocument
|
CurieSearchDocument
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
CurieSearchQuery
|
CurieSearchQuery
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
DavinciSearchDocument
|
DavinciSearchDocument
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
DavinciSearchQuery
|
DavinciSearchQuery
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
AdaCodeSearchCode
|
AdaCodeSearchCode
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
AdaCodeSearchText
|
AdaCodeSearchText
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
BabbageCodeSearchCode
|
BabbageCodeSearchCode
|
||||||
|
// Deprecated: Will be shut down on January 04, 2024. Use text-embedding-ada-002 instead.
|
||||||
BabbageCodeSearchText
|
BabbageCodeSearchText
|
||||||
AdaEmbeddingV2
|
AdaEmbeddingV2
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user