diff --git a/module/ai/dto/output.go b/module/ai/dto/output.go index 263b09ad..9f14778a 100644 --- a/module/ai/dto/output.go +++ b/module/ai/dto/output.go @@ -83,6 +83,7 @@ type BackupProvider struct { type LLMItem struct { Id string `json:"id"` + Name string `json:"name"` Logo string `json:"logo"` Config string `json:"config"` AccessConfiguration string `json:"access_configuration"` diff --git a/module/ai/iml.go b/module/ai/iml.go index 658cf0f0..eb79576e 100644 --- a/module/ai/iml.go +++ b/module/ai/iml.go @@ -411,12 +411,16 @@ func (i *imlProviderModule) UnConfiguredProviders(ctx context.Context) ([]*ai_dt // 已配置,跳过 continue } + defaultLLMID := "" defaultLLM, _ := v.DefaultModel(model_runtime.ModelTypeLLM) + if defaultLLM != nil { + defaultLLMID = defaultLLM.ID() + } item := &ai_dto.ProviderItem{ Id: v.ID(), Name: v.Name(), Logo: v.Logo(), - DefaultLLM: defaultLLM.ID(), + DefaultLLM: defaultLLMID, Sort: v.Sort(), } items = append(items, item) @@ -508,6 +512,7 @@ func (i *imlProviderModule) LLMs(ctx context.Context, driver string) ([]*ai_dto. for _, v := range llms { items = append(items, &ai_dto.LLMItem{ Id: v.ID(), + Name: v.Name(), Logo: v.Logo(), Config: v.DefaultConfig(), AccessConfiguration: v.AccessConfiguration(),