compatibility

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker handles compatibility checking between templates and providers

func NewChecker

func NewChecker(toolVersion string) *Checker

NewChecker creates a new compatibility checker

func (*Checker) AddAvailableFeature

func (c *Checker) AddAvailableFeature(feature string)

AddAvailableFeature adds an available feature

func (*Checker) CheckCompatibility

func (c *Checker) CheckCompatibility(metadata *CompatibilityMetadata) (bool, []string)

CheckCompatibility checks if a template is compatible with the current environment

func (*Checker) CheckModelCompatibility

func (c *Checker) CheckModelCompatibility(metadata *CompatibilityMetadata, providerID, model string) (bool, []string)

CheckModelCompatibility checks if a template is compatible with a specific model

func (*Checker) CheckProviderCompatibility

func (c *Checker) CheckProviderCompatibility(metadata *CompatibilityMetadata, providerID string) (bool, []string)

CheckProviderCompatibility checks if a template is compatible with a specific provider

func (*Checker) GetAvailableFeatures

func (c *Checker) GetAvailableFeatures() []string

GetAvailableFeatures returns the list of available features

func (*Checker) GetProvider

func (c *Checker) GetProvider(providerID string) (*ProviderInfo, bool)

GetProvider returns information about a specific provider

func (*Checker) GetProviders

func (c *Checker) GetProviders() map[string]*ProviderInfo

GetProviders returns the list of registered providers

func (*Checker) IsModelSupported

func (c *Checker) IsModelSupported(providerID, model string) bool

IsModelSupported checks if a model is supported by a provider

func (*Checker) RegisterProvider

func (c *Checker) RegisterProvider(provider *ProviderInfo)

RegisterProvider registers a provider with the checker

func (*Checker) RemoveAvailableFeature

func (c *Checker) RemoveAvailableFeature(feature string)

RemoveAvailableFeature removes an available feature

func (*Checker) UnregisterProvider

func (c *Checker) UnregisterProvider(providerID string)

UnregisterProvider removes a provider from the checker

type CompatibilityMetadata

type CompatibilityMetadata struct {
	// MinToolVersion is the minimum tool version required
	MinToolVersion string `json:"min_tool_version"`
	// MaxToolVersion is the maximum tool version supported
	MaxToolVersion string `json:"max_tool_version"`
	// Providers is the list of compatible providers
	Providers []string `json:"providers"`
	// RequiredFeatures is the list of required features
	RequiredFeatures []string `json:"required_features"`
}

CompatibilityMetadata represents compatibility metadata for a template

func (*CompatibilityMetadata) HasRequiredFeatures

func (c *CompatibilityMetadata) HasRequiredFeatures(availableFeatures []string) bool

HasRequiredFeatures checks if the given features contain all required features

func (*CompatibilityMetadata) IsCompatibleWithModel

func (c *CompatibilityMetadata) IsCompatibleWithModel(modelID string) bool

IsCompatibleWithModel checks if the metadata is compatible with a model

func (*CompatibilityMetadata) IsCompatibleWithProvider

func (c *CompatibilityMetadata) IsCompatibleWithProvider(providerID string) bool

IsCompatibleWithProvider checks if the metadata is compatible with a provider

func (*CompatibilityMetadata) IsCompatibleWithToolVersion

func (c *CompatibilityMetadata) IsCompatibleWithToolVersion(version string) (bool, error)

IsCompatibleWithToolVersion checks if the metadata is compatible with a tool version

type MetadataValidator added in v0.8.0

type MetadataValidator struct {
	// RequiredFields defines required metadata fields
	RequiredFields []string
	// OptionalFields defines optional metadata fields
	OptionalFields []string
}

MetadataValidator validates template metadata

func NewMetadataValidator added in v0.8.0

func NewMetadataValidator() *MetadataValidator

NewMetadataValidator creates a new metadata validator

func (*MetadataValidator) GetOptionalFields added in v0.8.0

func (v *MetadataValidator) GetOptionalFields() []string

GetOptionalFields returns the list of optional fields

func (*MetadataValidator) GetRequiredFields added in v0.8.0

func (v *MetadataValidator) GetRequiredFields() []string

GetRequiredFields returns the list of required fields

func (*MetadataValidator) IsOptionalField added in v0.8.0

func (v *MetadataValidator) IsOptionalField(field string) bool

IsOptionalField checks if a field is optional

func (*MetadataValidator) IsRequiredField added in v0.8.0

func (v *MetadataValidator) IsRequiredField(field string) bool

IsRequiredField checks if a field is required

func (*MetadataValidator) IsValidField added in v0.8.0

func (v *MetadataValidator) IsValidField(field string) bool

IsValidField checks if a field is valid (either required or optional)

func (*MetadataValidator) NormalizeMetadata added in v0.8.0

func (v *MetadataValidator) NormalizeMetadata(metadata map[string]interface{}) map[string]interface{}

NormalizeMetadata normalizes metadata fields

func (*MetadataValidator) Validate added in v0.8.0

func (v *MetadataValidator) Validate(metadata map[string]interface{}) error

Validate validates metadata

func (*MetadataValidator) ValidateField added in v0.8.0

func (v *MetadataValidator) ValidateField(field string, value interface{}) error

ValidateField validates a single metadata field

type ProviderInfo

type ProviderInfo struct {
	ID              string   `json:"id"`
	Name            string   `json:"name"`
	Version         string   `json:"version"`
	SupportedModels []string `json:"supported_models"`
	Features        []string `json:"features"`
}

ProviderInfo represents information about an LLM provider

Jump to

Keyboard shortcuts

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