mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-26 16:01:56 +08:00
finish nvidia
This commit is contained in:
@@ -31,4 +31,4 @@ provider_credential_schema:
|
||||
placeholder:
|
||||
zh_Hans: 在此输入您的 API Key
|
||||
en_US: Enter your API Key
|
||||
address: https://api.openai.com
|
||||
address: https://integrate.api.nvidia.com
|
||||
@@ -106,17 +106,21 @@ func (i *imlServiceController) CreateAIService(ctx *gin.Context, teamID string,
|
||||
input.Prefix = input.Id[:8]
|
||||
}
|
||||
}
|
||||
pv, err := i.providerModule.Provider(ctx, *input.Provider)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
p, has := model_runtime.GetProvider(*input.Provider)
|
||||
if !has {
|
||||
return nil, fmt.Errorf("provider not found")
|
||||
}
|
||||
m, has := p.DefaultModel(model_runtime.ModelTypeLLM)
|
||||
m, has := p.GetModel(pv.DefaultLLM)
|
||||
if !has {
|
||||
return nil, fmt.Errorf("provider default llm not found")
|
||||
return nil, fmt.Errorf("model %s not found", pv.DefaultLLM)
|
||||
}
|
||||
|
||||
var info *service_dto.Service
|
||||
err := i.transaction.Transaction(ctx, func(txCtx context.Context) error {
|
||||
err = i.transaction.Transaction(ctx, func(txCtx context.Context) error {
|
||||
var err error
|
||||
info, err = i.module.Create(ctx, teamID, input)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user