Update go version
This commit is contained in:
65
vendor/github.com/sashabaranov/go-openai/completion.go
generated
vendored
65
vendor/github.com/sashabaranov/go-openai/completion.go
generated
vendored
@@ -5,10 +5,9 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// GPT3 Defines the models provided by OpenAI to use when generating
|
||||
// completions from OpenAI.
|
||||
// GPT3 Models are designed for text-based tasks. For code-specific
|
||||
// tasks, please refer to the Codex series of models.
|
||||
const completionsSuffix = "/completions"
|
||||
|
||||
// Text generation and reasoning models provided by OpenAI.
|
||||
const (
|
||||
O1Mini = "o1-mini"
|
||||
O1Mini20240912 = "o1-mini-2024-09-12"
|
||||
@@ -20,8 +19,11 @@ const (
|
||||
O320250416 = "o3-2025-04-16"
|
||||
O3Mini = "o3-mini"
|
||||
O3Mini20250131 = "o3-mini-2025-01-31"
|
||||
O3Pro = "o3-pro"
|
||||
O3DeepResearch = "o3-deep-research"
|
||||
O4Mini = "o4-mini"
|
||||
O4Mini20250416 = "o4-mini-2025-04-16"
|
||||
O4MiniDeepResearch = "o4-mini-deep-research"
|
||||
GPT432K0613 = "gpt-4-32k-0613"
|
||||
GPT432K0314 = "gpt-4-32k-0314"
|
||||
GPT432K = "gpt-4-32k"
|
||||
@@ -52,7 +54,30 @@ const (
|
||||
GPT5 = "gpt-5"
|
||||
GPT5Mini = "gpt-5-mini"
|
||||
GPT5Nano = "gpt-5-nano"
|
||||
GPT5Pro = "gpt-5-pro"
|
||||
GPT5ChatLatest = "gpt-5-chat-latest"
|
||||
GPT5Codex = "gpt-5-codex"
|
||||
GPT5Dot1 = "gpt-5.1"
|
||||
GPT5Dot1ChatLatest = "gpt-5.1-chat-latest"
|
||||
GPT5Dot1Codex = "gpt-5.1-codex"
|
||||
GPT5Dot1CodexMini = "gpt-5.1-codex-mini"
|
||||
GPT5Dot1CodexMax = "gpt-5.1-codex-max"
|
||||
GPT5Dot2 = "gpt-5.2"
|
||||
GPT5Dot2ChatLatest = "gpt-5.2-chat-latest"
|
||||
GPT5Dot2Pro = "gpt-5.2-pro"
|
||||
GPT5Dot2Codex = "gpt-5.2-codex"
|
||||
GPT5Dot3ChatLatest = "gpt-5.3-chat-latest"
|
||||
GPT5Dot3Codex = "gpt-5.3-codex"
|
||||
GPT5Dot4 = "gpt-5.4"
|
||||
GPT5Dot4Mini = "gpt-5.4-mini"
|
||||
GPT5Dot4Nano = "gpt-5.4-nano"
|
||||
GPT5Dot4Pro = "gpt-5.4-pro"
|
||||
GPT5Dot5 = "gpt-5.5"
|
||||
GPT5Dot5Pro = "gpt-5.5-pro"
|
||||
GPT5Dot6 = "gpt-5.6"
|
||||
GPT5Dot6Sol = "gpt-5.6-sol"
|
||||
GPT5Dot6Terra = "gpt-5.6-terra"
|
||||
GPT5Dot6Luna = "gpt-5.6-luna"
|
||||
GPT3Dot5Turbo0125 = "gpt-3.5-turbo-0125"
|
||||
GPT3Dot5Turbo1106 = "gpt-3.5-turbo-1106"
|
||||
GPT3Dot5Turbo0613 = "gpt-3.5-turbo-0613"
|
||||
@@ -100,15 +125,18 @@ const (
|
||||
)
|
||||
|
||||
var disabledModelsForEndpoints = map[string]map[string]bool{
|
||||
"/completions": {
|
||||
completionsSuffix: {
|
||||
O1Mini: true,
|
||||
O1Mini20240912: true,
|
||||
O1Preview: true,
|
||||
O1Preview20240912: true,
|
||||
O3Mini: true,
|
||||
O3Mini20250131: true,
|
||||
O3Pro: true,
|
||||
O3DeepResearch: true,
|
||||
O4Mini: true,
|
||||
O4Mini20250416: true,
|
||||
O4MiniDeepResearch: true,
|
||||
O3: true,
|
||||
O320250416: true,
|
||||
GPT3Dot5Turbo: true,
|
||||
@@ -149,7 +177,30 @@ var disabledModelsForEndpoints = map[string]map[string]bool{
|
||||
GPT5: true,
|
||||
GPT5Mini: true,
|
||||
GPT5Nano: true,
|
||||
GPT5Pro: true,
|
||||
GPT5ChatLatest: true,
|
||||
GPT5Codex: true,
|
||||
GPT5Dot1: true,
|
||||
GPT5Dot1ChatLatest: true,
|
||||
GPT5Dot1Codex: true,
|
||||
GPT5Dot1CodexMini: true,
|
||||
GPT5Dot1CodexMax: true,
|
||||
GPT5Dot2: true,
|
||||
GPT5Dot2ChatLatest: true,
|
||||
GPT5Dot2Pro: true,
|
||||
GPT5Dot2Codex: true,
|
||||
GPT5Dot3ChatLatest: true,
|
||||
GPT5Dot3Codex: true,
|
||||
GPT5Dot4: true,
|
||||
GPT5Dot4Mini: true,
|
||||
GPT5Dot4Nano: true,
|
||||
GPT5Dot4Pro: true,
|
||||
GPT5Dot5: true,
|
||||
GPT5Dot5Pro: true,
|
||||
GPT5Dot6: true,
|
||||
GPT5Dot6Sol: true,
|
||||
GPT5Dot6Terra: true,
|
||||
GPT5Dot6Luna: true,
|
||||
},
|
||||
chatCompletionsSuffix: {
|
||||
CodexCodeDavinci002: true,
|
||||
@@ -218,7 +269,7 @@ type CompletionRequest struct {
|
||||
PresencePenalty float32 `json:"presence_penalty,omitempty"`
|
||||
Seed *int `json:"seed,omitempty"`
|
||||
Stop []string `json:"stop,omitempty"`
|
||||
Stream bool `json:"stream,omitempty"`
|
||||
Stream bool `json:"stream"`
|
||||
Suffix string `json:"suffix,omitempty"`
|
||||
Temperature float32 `json:"temperature,omitempty"`
|
||||
TopP float32 `json:"top_p,omitempty"`
|
||||
@@ -269,7 +320,7 @@ func (c *Client) CreateCompletion(
|
||||
return
|
||||
}
|
||||
|
||||
urlSuffix := "/completions"
|
||||
urlSuffix := completionsSuffix
|
||||
if !checkEndpointSupportsModel(urlSuffix, request.Model) {
|
||||
err = ErrCompletionUnsupportedModel
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user