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)
| 95 | // When no predicate is set, every provider may trigger a fetch (the default, |
| 96 | // backwards-compatible behaviour). |
| 97 | func 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 |
no outgoing calls