MCPcopy Index your code
hub / github.com/docker/docker-agent / WithKnownProvider

Function WithKnownProvider

pkg/modelsdev/store.go:97–101  ·  view source on GitHub ↗

WithKnownProvider restricts which provider names may trigger an outbound fetch of the models.dev catalog. The predicate should report whether a provider is one models.dev could plausibly contain (a built-in or alias). Looking up a model for a provider the predicate rejects — typically a user-define

(fn func(string) bool)

Source from the content-addressed store, hash-verified

95// When no predicate is set, every provider may trigger a fetch (the default,
96// backwards-compatible behaviour).
97func WithKnownProvider(fn func(string) bool) Opt {
98 return func(o *storeOptions) {
99 o.knownProvider = fn
100 }
101}
102
103// NewStore creates a new Store backed by an on-disk cache. By default the
104// cache lives at ~/.cagent/models_dev.json; use WithCache to override the

Callers 5

loadMethod · 0.92
ModelsDevStoreMethod · 0.92

Calls

no outgoing calls