MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / List

Method List

service/ai-local/iml.go:229–241  ·  view source on GitHub ↗
(ctx context.Context, model string, typ CacheType)

Source from the content-addressed store, hash-verified

227}
228
229func (i *imlLocalModelCacheService) List(ctx context.Context, model string, typ CacheType) ([]*LocalModelCache, error) {
230 list, err := i.store.List(ctx, map[string]interface{}{"model": model, "type": typ.Int()})
231 if err != nil {
232 return nil, err
233 }
234 return utils.SliceToSlice(list, func(s *ai.LocalModelCache) *LocalModelCache {
235 return &LocalModelCache{
236 Model: s.Model,
237 Target: s.Target,
238 Type: CacheType(s.Type),
239 }
240 }), nil
241}
242
243func (i *imlLocalModelCacheService) Delete(ctx context.Context, model string) error {
244 _, err := i.store.DeleteWhere(ctx, map[string]interface{}{"model": model})

Callers

nothing calls this directly

Calls 3

CacheTypeTypeAlias · 0.85
ListMethod · 0.65
IntMethod · 0.45

Tested by

no test coverage detected