pub trait ModelFamilyProvider: Send + Sync {
type Config: Clone + Send + Sync + Serialize + DeserializeOwned + 'static;
// Required methods
fn family_id(&self) -> &ModelFamilyId;
fn external_metadata_ids(&self) -> BTreeSet<ExternalModelMetadataId>;
fn validate_config_identity(
&self,
raw: &Value,
config: &Self::Config,
) -> Result<(), VNextError>;
fn validated_external_metadata_id(
&self,
raw: &Value,
config: &Self::Config,
) -> Result<ExternalModelMetadataId, VNextError>;
fn parse_config(&self, raw: &Value) -> Result<Self::Config, VNextError>;
fn weight_schema(
&self,
config: &Self::Config,
) -> Result<WeightSchema, VNextError>;
fn semantic_program(
&self,
config: &Self::Config,
) -> Result<ModelProgram, VNextError>;
fn semantic_metadata(
&self,
config: &Self::Config,
) -> Result<ModelSemanticMetadata, VNextError>;
}Expand description
Compile-time model family provider with a typed, validated configuration.
Required Associated Types§
Required Methods§
fn family_id(&self) -> &ModelFamilyId
fn external_metadata_ids(&self) -> BTreeSet<ExternalModelMetadataId>
fn validate_config_identity( &self, raw: &Value, config: &Self::Config, ) -> Result<(), VNextError>
Sourcefn validated_external_metadata_id(
&self,
raw: &Value,
config: &Self::Config,
) -> Result<ExternalModelMetadataId, VNextError>
fn validated_external_metadata_id( &self, raw: &Value, config: &Self::Config, ) -> Result<ExternalModelMetadataId, VNextError>
Returns the exact external metadata identity represented by config.
Every provider must make this selection explicit; core never assumes a
singleton catalog row is the intended typed identity.
fn parse_config(&self, raw: &Value) -> Result<Self::Config, VNextError>
fn weight_schema( &self, config: &Self::Config, ) -> Result<WeightSchema, VNextError>
fn semantic_program( &self, config: &Self::Config, ) -> Result<ModelProgram, VNextError>
fn semantic_metadata( &self, config: &Self::Config, ) -> Result<ModelSemanticMetadata, VNextError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".