(ctx context.Context, id string)
| 231 | } |
| 232 | |
| 233 | func (i *imlProviderModule) SimpleProvider(ctx context.Context, id string) (*ai_dto.SimpleProvider, error) { |
| 234 | p, has := model_runtime.GetProvider(id) |
| 235 | if !has { |
| 236 | return nil, fmt.Errorf("ai provider not found") |
| 237 | } |
| 238 | return &ai_dto.SimpleProvider{ |
| 239 | Id: p.ID(), |
| 240 | Name: p.Name(), |
| 241 | Logo: p.Logo(), |
| 242 | DefaultConfig: p.DefaultConfig(), |
| 243 | GetAPIKeyUrl: p.HelpUrl(), |
| 244 | }, nil |
| 245 | } |
| 246 | |
| 247 | func (i *imlProviderModule) ConfiguredProviders(ctx context.Context, keyword string) ([]*ai_dto.ConfiguredProviderItem, error) { |
| 248 | // 获取已配置的AI服务商 |
nothing calls this directly
no test coverage detected