fix: remove validateO1Specific (#939)
* fix: remove validateO1Specific * update golangci-lint-action version * fix actions * fix actions * fix actions * fix actions * remove some o1 test
This commit is contained in:
@@ -28,16 +28,6 @@ var (
|
||||
ErrReasoningModelLimitationsOther = 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
|
||||
)
|
||||
|
||||
var unsupportedToolsForO1Models = map[ToolType]struct{}{
|
||||
ToolTypeFunction: {},
|
||||
}
|
||||
|
||||
var availableMessageRoleForO1Models = map[string]struct{}{
|
||||
ChatMessageRoleUser: {},
|
||||
ChatMessageRoleAssistant: {},
|
||||
ChatMessageRoleDeveloper: {},
|
||||
}
|
||||
|
||||
// ReasoningValidator handles validation for o-series model requests.
|
||||
type ReasoningValidator struct{}
|
||||
|
||||
@@ -59,12 +49,6 @@ func (v *ReasoningValidator) Validate(request ChatCompletionRequest) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if o1Series {
|
||||
if err := v.validateO1Specific(request); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -94,19 +78,3 @@ func (v *ReasoningValidator) validateReasoningModelParams(request ChatCompletion
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// validateO1Specific checks O1-specific limitations.
|
||||
func (v *ReasoningValidator) validateO1Specific(request ChatCompletionRequest) error {
|
||||
for _, m := range request.Messages {
|
||||
if _, found := availableMessageRoleForO1Models[m.Role]; !found {
|
||||
return ErrO1BetaLimitationsMessageTypes
|
||||
}
|
||||
}
|
||||
|
||||
for _, t := range request.Tools {
|
||||
if _, found := unsupportedToolsForO1Models[t.Type]; found {
|
||||
return ErrO1BetaLimitationsTools
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user