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

Method GetByTarget

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

Source from the content-addressed store, hash-verified

215}
216
217func (i *imlLocalModelCacheService) GetByTarget(ctx context.Context, typ CacheType, target string) (*LocalModelCache, error) {
218 item, err := i.store.First(ctx, map[string]interface{}{"target": target, "type": typ.Int()})
219 if err != nil {
220 return nil, err
221 }
222 return &LocalModelCache{
223 Model: item.Model,
224 Target: item.Target,
225 Type: CacheType(item.Type),
226 }, nil
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()})

Callers

nothing calls this directly

Calls 2

CacheTypeTypeAlias · 0.85
IntMethod · 0.45

Tested by

no test coverage detected