Help us shape the future of Go! Take the 2026 Go Developer Survey

modelcatalog

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeStoredManagedModel

func DecodeStoredManagedModel(data []byte) (any, error)

Types

type ManagedModel

type ManagedModel struct {
	ProviderID          string                      `json:"provider_id"`
	UpstreamModel       string                      `json:"upstream_model"`
	CredentialScope     string                      `json:"credential_scope,omitempty"`
	Enabled             bool                        `json:"enabled"`
	CapabilityOverrides *provider.ModelCapabilities `json:"capability_overrides,omitempty"`
}

func (*ManagedModel) ModelStorageKey

func (m *ManagedModel) ModelStorageKey() (string, string)

func (*ManagedModel) Normalize

func (m *ManagedModel) Normalize()

type ManagedModelFilter

type ManagedModelFilter struct {
	ProviderID string
}

type ProviderModelSnapshot

type ProviderModelSnapshot struct {
	ProviderID    string                     `json:"provider_id"`
	ProviderType  string                     `json:"provider_type"`
	UpstreamModel string                     `json:"upstream_model"`
	DisplayName   string                     `json:"display_name,omitempty"`
	Description   string                     `json:"description,omitempty"`
	Capabilities  provider.ModelCapabilities `json:"capabilities,omitempty"`
	Status        SnapshotStatus             `json:"status"`
	FetchedAt     time.Time                  `json:"fetched_at"`
	LastError     string                     `json:"last_error,omitempty"`
}

type ResolvedManagedModel

type ResolvedManagedModel struct {
	ManagedModel
	Snapshot     *ProviderModelSnapshot     `json:"snapshot,omitempty"`
	Capabilities provider.ModelCapabilities `json:"capabilities,omitempty"`
}

type Service

type Service interface {
	RefreshProvider(ctx context.Context, providerID string) error
	ListManagedModels(ctx context.Context, filter ManagedModelFilter) ([]ManagedModel, error)
	GetManagedModel(ctx context.Context, providerID string, upstreamModel string) (*ManagedModel, bool, error)
	GetResolvedManagedModel(ctx context.Context, providerID string, upstreamModel string) (*ResolvedManagedModel, bool, error)
	CreateManagedModel(ctx context.Context, model ManagedModel) error
	UpdateManagedModel(ctx context.Context, model ManagedModel) error
	DeleteManagedModel(ctx context.Context, providerID string, upstreamModel string) error
	ListProviderSnapshots(ctx context.Context, providerID string) ([]ProviderModelSnapshot, error)
}

func NewService

func NewService(store configstore.ConfigStore, providerMgr providerResolver, logger *zap.Logger) Service

type SnapshotStatus

type SnapshotStatus string
const (
	SnapshotStatusOK    SnapshotStatus = "ok"
	SnapshotStatusError SnapshotStatus = "error"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL