You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Deprecate `ErrO1BetaLimitationsLogprobs` and `ErrO1BetaLimitationsOther`
- Implement `validationRequestForReasoningModels`, which works on both o1 & o3, and has per-model-type restrictions on functionality (eg, o3 class are allowed function calls and system messages, o1 isn't)
Copy file name to clipboardExpand all lines: completion.go
+42-47
Original file line number
Diff line number
Diff line change
@@ -7,20 +7,23 @@ import (
7
7
)
8
8
9
9
var (
10
+
// Deprecated: use ErrO3MaxTokensDeprecated instead.
10
11
ErrO1MaxTokensDeprecated=errors.New("this model is not supported MaxTokens, please use MaxCompletionTokens") //nolint:lll
11
12
ErrCompletionUnsupportedModel=errors.New("this model is not supported with this method, please use CreateChatCompletion client method instead") //nolint:lll
12
13
ErrCompletionStreamNotSupported=errors.New("streaming is not supported with this method, please use CreateCompletionStream") //nolint:lll
13
14
ErrCompletionRequestPromptTypeNotSupported=errors.New("the type of CompletionRequest.Prompt only supports string and []string") //nolint:lll
14
15
)
15
16
16
17
var (
17
-
ErrO1BetaLimitationsMessageTypes=errors.New("this model has beta-limitations, user and assistant messages only, system messages are not supported") //nolint:lll
18
-
ErrO1BetaLimitationsTools=errors.New("this model has beta-limitations, tools, function calling, and response format parameters are not supported") //nolint:lll
19
-
ErrO1BetaLimitationsLogprobs=errors.New("this model has beta-limitations, logprobs not supported") //nolint:lll
20
-
ErrO1BetaLimitationsOther=errors.New("this model has beta-limitations, temperature, top_p and n are fixed at 1, while presence_penalty and frequency_penalty are fixed at 0") //nolint:lll
18
+
ErrO1BetaLimitationsMessageTypes=errors.New("this model has beta-limitations, user and assistant messages only, system messages are not supported") //nolint:lll
19
+
ErrO1BetaLimitationsTools=errors.New("this model has beta-limitations, tools, function calling, and response format parameters are not supported") //nolint:lll
20
+
// Deprecated: use Err03BetaLimitations* instead.
21
+
ErrO1BetaLimitationsLogprobs=errors.New("this model has beta-limitations, logprobs not supported") //nolint:lll
22
+
ErrO1BetaLimitationsOther=errors.New("this model has beta-limitations, temperature, top_p and n are fixed at 1, while presence_penalty and frequency_penalty are fixed at 0") //nolint:lll
21
23
)
22
24
23
25
var (
26
+
ErrO3MaxTokensDeprecated=errors.New("this model is not supported MaxTokens, please use MaxCompletionTokens")
24
27
ErrO3BetaLimitationsLogprobs=errors.New("this model has beta-limitations, logprobs not supported") //nolint:lll
25
28
ErrO3BetaLimitationsOther=errors.New("this model has beta-limitations, temperature, top_p and n are fixed at 1, while presence_penalty and frequency_penalty are fixed at 0") //nolint:lll
26
29
)
@@ -207,67 +210,44 @@ var availableMessageRoleForO1Models = map[string]struct{}{
207
210
ChatMessageRoleAssistant: {},
208
211
}
209
212
210
-
// validateRequestForO1Models checks for deprecated fields of OpenAI models.
0 commit comments