fix: fail to get ai api model name

This commit is contained in:
Liujian
2025-03-11 17:16:42 +08:00
parent 6bb818b9a1
commit 9fc48341f7
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -54,7 +54,7 @@ func (i *imlAPIController) Create(ctx *gin.Context, serviceId string, input *ai_
}
plugins["ai_formatter"] = api.PluginSetting{
Config: plugin_model.ConfigType{
"model": input.AiModel.Id,
"model": input.AiModel.Name,
"provider": provider,
"config": input.AiModel.Config,
},
@@ -113,7 +113,7 @@ func (i *imlAPIController) Edit(ctx *gin.Context, serviceId string, apiId string
}
proxy.Plugins["ai_formatter"] = api.PluginSetting{
Config: plugin_model.ConfigType{
"model": input.AiModel.Id,
"model": input.AiModel.Name,
"provider": provider,
"config": input.AiModel.Config,
},
+1 -1
View File
@@ -279,7 +279,7 @@ func (i *imlBalanceModule) getLocalBalances(ctx context.Context, v string) ([]*g
if !has {
continue
}
base = fmt.Sprintf("%s://%s", p.URI().Scheme(), p.URI().Host())
base = fmt.Sprintf("%s://%s%s", p.URI().Scheme(), p.URI().Host(), p.URI().Path())
}
releases = append(releases, newRelease(item, base))
}
+1 -1
View File
@@ -673,7 +673,7 @@ func (i *imlProviderModule) UpdateProviderConfig(ctx context.Context, id string,
cfg["provider"] = info.Id
cfg["model"] = model.Name()
cfg["model_config"] = model.DefaultConfig()
cfg["base"] = fmt.Sprintf("%s://%s", p.URI().Scheme(), p.URI().Host())
cfg["base"] = fmt.Sprintf("%s://%s%s", p.URI().Scheme(), p.URI().Host(), p.URI().Path())
return i.syncGateway(ctx, cluster.DefaultClusterID, []*gateway.DynamicRelease{
{
BasicItem: &gateway.BasicItem{