mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-14 20:41:15 +08:00
Merge branch 'feature/sunanzhi/1.6' into 'main'
refactor: remove validation for checking provider existence in model addition See merge request apipark/APIPark!258
This commit is contained in:
@@ -111,14 +111,6 @@ func (i *imlProviderModelModule) AddProviderModel(ctx *gin.Context, provider str
|
||||
if !has {
|
||||
return nil, fmt.Errorf("ai provider not found")
|
||||
}
|
||||
// check provider exist
|
||||
providerInfo, err := i.providerService.Get(ctx, provider)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if providerInfo == nil {
|
||||
return nil, fmt.Errorf("provider not found")
|
||||
}
|
||||
// check model name duplicate
|
||||
if has := i.providerModelService.CheckNameDuplicate(ctx, provider, input.Name, ""); has {
|
||||
return nil, fmt.Errorf("model name: `%s` duplicate", input.Name)
|
||||
|
||||
Reference in New Issue
Block a user