mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-04 10:13:53 +08:00
Merge pull request #247 from APIParkLab/feature/sunanzhi/1.6
fix: resolve inaccurate display of model content
This commit is contained in:
@@ -50,7 +50,7 @@ type IProviderInfo interface {
|
||||
}
|
||||
|
||||
func GetCustomizeLogo() string {
|
||||
logo, _ := providerDir.ReadFile("customize/assets/icon_s_en.svg")
|
||||
logo, _ := providerDir.ReadFile("model-providers/customize/assets/icon_s_en.svg")
|
||||
|
||||
return string(logo)
|
||||
}
|
||||
|
||||
+10
-9
@@ -37,15 +37,16 @@ type ModelConfig struct {
|
||||
}
|
||||
|
||||
type ConfiguredProviderItem struct {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Logo string `json:"logo"`
|
||||
DefaultLLM string `json:"default_llm"`
|
||||
Status ProviderStatus `json:"status"`
|
||||
APICount int64 `json:"api_count"`
|
||||
KeyCount int64 `json:"key_count"`
|
||||
ModelCount int64 `json:"model_count"`
|
||||
CanDelete bool `json:"can_delete"`
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Logo string `json:"logo"`
|
||||
DefaultLLM string `json:"default_llm"`
|
||||
DefaultLLMName string `json:"default_llm_name"`
|
||||
Status ProviderStatus `json:"status"`
|
||||
APICount int64 `json:"api_count"`
|
||||
KeyCount int64 `json:"key_count"`
|
||||
ModelCount int64 `json:"model_count"`
|
||||
CanDelete bool `json:"can_delete"`
|
||||
}
|
||||
|
||||
type KeyStatus struct {
|
||||
|
||||
+15
-11
@@ -219,7 +219,7 @@ func (i *imlProviderModule) AddProvider(ctx context.Context, input *ai_dto.NewPr
|
||||
Id: input.Name,
|
||||
Name: input.Name,
|
||||
DefaultConfig: config,
|
||||
Logo: model_runtime.GetCustomizeLogo(),
|
||||
Logo: iProvider.Logo(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -280,17 +280,21 @@ func (i *imlProviderModule) ConfiguredProviders(ctx context.Context, keyword str
|
||||
continue
|
||||
}
|
||||
apiCount := aiAPIMap[l.Id]
|
||||
|
||||
defaultLLMName := ""
|
||||
if defaultModel, has := p.GetModel(l.DefaultLLM); has {
|
||||
defaultLLMName = defaultModel.Name()
|
||||
}
|
||||
providers = append(providers, &ai_dto.ConfiguredProviderItem{
|
||||
Id: l.Id,
|
||||
Name: l.Name,
|
||||
Logo: p.Logo(),
|
||||
DefaultLLM: l.DefaultLLM,
|
||||
Status: ai_dto.ToProviderStatus(l.Status),
|
||||
APICount: apiCount,
|
||||
KeyCount: keyMap[l.Id],
|
||||
CanDelete: apiCount < 1,
|
||||
ModelCount: int64(len(p.Models())),
|
||||
Id: l.Id,
|
||||
Name: l.Name,
|
||||
Logo: p.Logo(),
|
||||
DefaultLLM: l.DefaultLLM,
|
||||
DefaultLLMName: defaultLLMName,
|
||||
Status: ai_dto.ToProviderStatus(l.Status),
|
||||
APICount: apiCount,
|
||||
KeyCount: keyMap[l.Id],
|
||||
CanDelete: apiCount < 1,
|
||||
ModelCount: int64(len(p.Models())),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user