MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / SimpleList

Method SimpleList

module/ai-local/iml.go:68–86  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

66}
67
68func (i *imlLocalModel) SimpleList(ctx context.Context) ([]*ai_local_dto.SimpleItem, error) {
69 list, err := i.localModelService.List(ctx)
70 if err != nil {
71 return nil, err
72 }
73 return utils.SliceToSlice(list, func(s *ai_local.LocalModel) *ai_local_dto.SimpleItem {
74 return &ai_local_dto.SimpleItem{
75 Id: s.Id,
76 Name: s.Name,
77 DefaultConfig: ai_provider_local.LocalConfig,
78 Logo: ai_provider_local.LocalSvg,
79 }
80 }, func(l *ai_local.LocalModel) bool {
81 if l.State != ai_local_dto.LocalModelStateNormal.Int() && l.State != ai_local_dto.LocalModelStateDisable.Int() {
82 return false
83 }
84 return true
85 }), nil
86}
87
88func (i *imlLocalModel) ModelState(ctx context.Context, model string) (*ai_local_dto.DeployState, *ai_local_dto.ModelInfo, error) {
89 info, err := i.localModelStateService.Get(ctx, model)

Callers

nothing calls this directly

Calls 2

ListMethod · 0.65
IntMethod · 0.45

Tested by

no test coverage detected