compatibility

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 3 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 {
	// Compatible providers (e.g., "openai", "anthropic")
	Providers []string `json:"providers,omitempty" yaml:"providers,omitempty"`

	// Minimum tool version required (e.g., "1.0.0")
	MinToolVersion string `json:"min_tool_version,omitempty" yaml:"min_tool_version,omitempty"`

	// Maximum tool version supported (e.g., "2.0.0") - optional
	MaxToolVersion string `json:"max_tool_version,omitempty" yaml:"max_tool_version,omitempty"`

	// Supported models for each provider
	SupportedModels map[string][]string `json:"supported_models,omitempty" yaml:"supported_models,omitempty"`

	// Required features that must be supported
	RequiredFeatures []string `json:"required_features,omitempty" yaml:"required_features,omitempty"`

	// Additional metadata
	Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"`
}

CompatibilityMetadata represents compatibility information for templates and modules

func NewCompatibilityMetadata

func NewCompatibilityMetadata() *CompatibilityMetadata

NewCompatibilityMetadata creates a new compatibility metadata instance

func (*CompatibilityMetadata) AddProvider

func (cm *CompatibilityMetadata) AddProvider(provider string)

AddProvider adds a provider to the compatibility metadata

func (*CompatibilityMetadata) AddRequiredFeature

func (cm *CompatibilityMetadata) AddRequiredFeature(feature string)

AddRequiredFeature adds a required feature

func (*CompatibilityMetadata) AddSupportedModel

func (cm *CompatibilityMetadata) AddSupportedModel(provider, model string)

AddSupportedModel adds a supported model for a provider

func (*CompatibilityMetadata) GetMetadata

func (cm *CompatibilityMetadata) GetMetadata(key string) (interface{}, bool)

GetMetadata gets a metadata value

func (*CompatibilityMetadata) HasRequiredFeatures

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

HasRequiredFeatures checks if all required features are available

func (*CompatibilityMetadata) IsCompatibleWithModel

func (cm *CompatibilityMetadata) IsCompatibleWithModel(provider, model string) bool

IsCompatibleWithModel checks if the metadata is compatible with a model

func (*CompatibilityMetadata) IsCompatibleWithProvider

func (cm *CompatibilityMetadata) IsCompatibleWithProvider(provider string) bool

IsCompatibleWithProvider checks if the metadata is compatible with a provider

func (*CompatibilityMetadata) IsCompatibleWithToolVersion

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

IsCompatibleWithToolVersion checks if the metadata is compatible with a tool version

func (*CompatibilityMetadata) Merge

func (cm *CompatibilityMetadata) Merge(other *CompatibilityMetadata)

Merge merges another compatibility metadata into this one

func (*CompatibilityMetadata) RemoveMetadata

func (cm *CompatibilityMetadata) RemoveMetadata(key string)

RemoveMetadata removes a metadata value

func (*CompatibilityMetadata) RemoveProvider

func (cm *CompatibilityMetadata) RemoveProvider(provider string)

RemoveProvider removes a provider from the compatibility metadata

func (*CompatibilityMetadata) RemoveRequiredFeature

func (cm *CompatibilityMetadata) RemoveRequiredFeature(feature string)

RemoveRequiredFeature removes a required feature

func (*CompatibilityMetadata) RemoveSupportedModel

func (cm *CompatibilityMetadata) RemoveSupportedModel(provider, model string)

RemoveSupportedModel removes a supported model for a provider

func (*CompatibilityMetadata) SetMaxToolVersion

func (cm *CompatibilityMetadata) SetMaxToolVersion(version string) error

SetMaxToolVersion sets the maximum tool version supported

func (*CompatibilityMetadata) SetMetadata

func (cm *CompatibilityMetadata) SetMetadata(key string, value interface{})

SetMetadata sets a metadata value

func (*CompatibilityMetadata) SetMinToolVersion

func (cm *CompatibilityMetadata) SetMinToolVersion(version string) error

SetMinToolVersion sets the minimum tool version required

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