modelcatalog

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package modelcatalog provides pure, offline utilities to match user-provided model endpoints and provider types to the built-in catwalk model catalogue. It maps custom endpoint URLs and provider types to rich model metadata without performing any network I/O.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProviderByType

func ProviderByType(providerType string) (catwalk.Provider, bool)

ProviderByType looks up a catalogued provider solely by its type string. This is used for type-based lookups when custom URLs are absent.

Types

type MatchKind

type MatchKind int

MatchKind represents how a provider was resolved in the catalogue.

const (
	// MatchNone indicates the provider or URL could not be resolved.
	MatchNone MatchKind = iota
	// MatchByType indicates the lookup was resolved purely by provider type.
	MatchByType
	// MatchByURLExact indicates the URL matched an endpoint in the catalogue exactly.
	MatchByURLExact
	// MatchByURLHost indicates the URL matched a unique host in the catalogue.
	MatchByURLHost
)

func Resolve

func Resolve(providerType, url string) (catwalk.Provider, MatchKind, bool)

Resolve maps a provider type and optional custom URL to a catalogued provider. It resolves the provider in the exact order specified: 1. If the URL is empty, it looks up the provider by type. 2. If the URL is non-empty, it matches against non-placeholder API endpoints. It first attempts an exact match of the normalized URL, then falls back to a host-unique match.

Jump to

Keyboard shortcuts

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