modelcap

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindUnknown    = "unknown"
	KindChat       = "chat"
	KindCompletion = "completion"
	KindResponses  = "responses"
	KindEmbedding  = "embedding"
	KindRerank     = "rerank"
	KindImage      = "image"
	KindAudio      = "audio"
	KindControl    = "control"

	SourceOverride      = "override"
	SourceModelIDHint   = "model_id_hint"
	SourceOpenAIModels  = "openai:/v1/models"
	SourceLiteLLMInfo   = "litellm:/model/info"
	SourceOpenAIAdapter = "gateway:openai-adapter"
)

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) *bool

func Int64

func Int64(value int64) *int64

func IsRoutableKind

func IsRoutableKind(kind string) bool

IsRoutableKind reports whether CCR can safely use a model through a conversational Anthropic-compatible gateway route. Empty and unknown kinds remain routable because discovery frequently omits this field.

func IsZeroSnapshot

func IsZeroSnapshot(snapshot Snapshot) bool

func IsZeroValues

func IsZeroValues(values Values) bool

func PopulatedFields

func PopulatedFields(values Values) []string

func SupportsOneMillion

func SupportsOneMillion(values Values) bool

func UsesSchemaV3Fields added in v0.3.0

func UsesSchemaV3Fields(values Values) bool

Types

type Snapshot

type Snapshot struct {
	Values  Values            `json:"values,omitempty"`
	Sources map[string]string `json:"sources,omitempty"`
}

Snapshot stores normalized values and per-field provenance from discovery.

func Effective

func Effective(discovered Snapshot, overrides Values, providerModel string) (Snapshot, error)

Effective merges discovered values, explicit overrides, and safe model-ID hints.

func MergeSnapshots

func MergeSnapshots(base, update Snapshot) (Snapshot, error)

MergeSnapshots overlays populated update fields while preserving unknown base fields.

func NormalizeSnapshot

func NormalizeSnapshot(snapshot Snapshot) (Snapshot, error)

func SnapshotFrom

func SnapshotFrom(values Values, source string) (Snapshot, error)

SnapshotFrom creates a normalized snapshot whose populated fields share one source.

type Values

type Values struct {
	Kind                   string   `json:"kind,omitempty"`
	ContextWindowTokens    *int64   `json:"context_window_tokens,omitempty"`
	MaxInputTokens         *int64   `json:"max_input_tokens,omitempty"`
	MaxOutputTokens        *int64   `json:"max_output_tokens,omitempty"`
	InputModalities        []string `json:"input_modalities,omitempty"`
	OutputModalities       []string `json:"output_modalities,omitempty"`
	SupportsTools          *bool    `json:"supports_tools,omitempty"`
	SupportsToolChoice     *bool    `json:"supports_tool_choice,omitempty"`
	SupportsParallelTools  *bool    `json:"supports_parallel_tools,omitempty"`
	SupportsStreaming      *bool    `json:"supports_streaming,omitempty"`
	SupportsThinking       *bool    `json:"supports_thinking,omitempty"`
	SupportsPromptCaching  *bool    `json:"supports_prompt_caching,omitempty"`
	SupportsSystemMessages *bool    `json:"supports_system_messages,omitempty"`
	SupportsVision         *bool    `json:"supports_vision,omitempty"`
	SupportsPDFInput       *bool    `json:"supports_pdf_input,omitempty"`
	SupportsAudioInput     *bool    `json:"supports_audio_input,omitempty"`
	SupportsAudioOutput    *bool    `json:"supports_audio_output,omitempty"`
	SupportsResponseSchema *bool    `json:"supports_response_schema,omitempty"`
	SupportsResponses      *bool    `json:"supports_responses,omitempty"`
	SupportsComputerUse    *bool    `json:"supports_computer_use,omitempty"`
	// contains filtered or unexported fields
}

Values is the normalized, provider-independent model capability contract. Pointer booleans distinguish an explicit false value from unknown metadata.

func NormalizeValues

func NormalizeValues(values Values) (Values, error)

func (*Values) UnmarshalJSON added in v0.3.0

func (v *Values) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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