Documentation
¶
Index ¶
- type CachedClient
- func (c *CachedClient) DeleteModel(ctx context.Context, model schema.Model) error
- func (c *CachedClient) DownloadModel(ctx context.Context, name string, opts ...opt.Opt) (*schema.Model, error)
- func (c *CachedClient) GetModel(ctx context.Context, name string) (*schema.Model, error)
- func (c *CachedClient) ListModels(ctx context.Context) ([]schema.Model, error)
- func (c *CachedClient) Self() llm.Client
- type Registry
- func (r *Registry) Count() int
- func (r *Registry) Get(name string) llm.Client
- func (r *Registry) GetModel(ctx context.Context, provider *schema.Provider, name string) (schema.Model, error)
- func (r *Registry) Ping(ctx context.Context) error
- func (r *Registry) Set(schema *schema.Provider, credentials schema.ProviderCredentials) (bool, bool, error)
- func (r *Registry) Sync(schema []*schema.Provider, ...) (updates []string, deletes []string, err error)
- func (r *Registry) Validate(ctx context.Context, provider schema.Provider, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedClient ¶
func NewCachedClient ¶
func NewCachedClient(client llm.Client, ttl time.Duration) *CachedClient
func (*CachedClient) DeleteModel ¶
func (*CachedClient) DownloadModel ¶
func (*CachedClient) GetModel ¶
GetModel fails fast on cached misses but still defers successful lookups to the provider.
func (*CachedClient) ListModels ¶
func (*CachedClient) Self ¶
func (c *CachedClient) Self() llm.Client
Self returns the underlying client implementation.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) GetModel ¶
func (r *Registry) GetModel(ctx context.Context, provider *schema.Provider, name string) (schema.Model, error)
GetModel returns a single model for a provider when the exact model name matches after include/exclude regex filtering has been applied.
func (*Registry) Set ¶
func (r *Registry) Set(schema *schema.Provider, credentials schema.ProviderCredentials) (bool, bool, error)
Sets or updates a provider client by name, if the provider is enabled, and return boolean flags indicating whether the provider was updated or deleted.
func (*Registry) Sync ¶
func (r *Registry) Sync(schema []*schema.Provider, decrypter func(i int) (schema.ProviderCredentials, error)) (updates []string, deletes []string, err error)
Syncronizes the registry with the provided list of provider schemas and a decrypter function to obtain credentials. It returns lists of updated and deleted provider names, along with any errors encountered during the sync process.