Documentation
¶
Index ¶
- type Checker
- func (c *Checker) AddAvailableFeature(feature string)
- func (c *Checker) CheckCompatibility(metadata *CompatibilityMetadata) (bool, []string)
- func (c *Checker) CheckModelCompatibility(metadata *CompatibilityMetadata, providerID, model string) (bool, []string)
- func (c *Checker) CheckProviderCompatibility(metadata *CompatibilityMetadata, providerID string) (bool, []string)
- func (c *Checker) GetAvailableFeatures() []string
- func (c *Checker) GetProvider(providerID string) (*ProviderInfo, bool)
- func (c *Checker) GetProviders() map[string]*ProviderInfo
- func (c *Checker) IsModelSupported(providerID, model string) bool
- func (c *Checker) RegisterProvider(provider *ProviderInfo)
- func (c *Checker) RemoveAvailableFeature(feature string)
- func (c *Checker) UnregisterProvider(providerID string)
- type CompatibilityMetadata
- func (c *CompatibilityMetadata) HasRequiredFeatures(availableFeatures []string) bool
- func (c *CompatibilityMetadata) IsCompatibleWithModel(modelID string) bool
- func (c *CompatibilityMetadata) IsCompatibleWithProvider(providerID string) bool
- func (c *CompatibilityMetadata) IsCompatibleWithToolVersion(version string) (bool, error)
- type MetadataValidator
- func (v *MetadataValidator) GetOptionalFields() []string
- func (v *MetadataValidator) GetRequiredFields() []string
- func (v *MetadataValidator) IsOptionalField(field string) bool
- func (v *MetadataValidator) IsRequiredField(field string) bool
- func (v *MetadataValidator) IsValidField(field string) bool
- func (v *MetadataValidator) NormalizeMetadata(metadata map[string]interface{}) map[string]interface{}
- func (v *MetadataValidator) Validate(metadata map[string]interface{}) error
- func (v *MetadataValidator) ValidateField(field string, value interface{}) error
- type ProviderInfo
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 ¶
NewChecker creates a new compatibility checker
func (*Checker) AddAvailableFeature ¶
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 ¶
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 ¶
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 ¶
RemoveAvailableFeature removes an available feature
func (*Checker) UnregisterProvider ¶
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