Factories
Factory class responsible for constructing ModelAsset objects based on high-level AssetConfig definitions. This utility centralizes the logic for assigning authentication-derived metadata (such as account_id) when creating assets for the Norman model registry.
The factory uses the global AuthenticationManager to retrieve the active account ID at creation time, ensuring that assets are always associated with the correct authenticated user.
InvocationConfigFactory
Factory responsible for constructing a fully populated InvocationConfig object from raw dictionary input. This includes validating the configuration using Pydantic and automatically inferring input sources when not explicitly provided.
This utility ensures consistent preprocessing of invocation metadata before execution by normalizing input definitions and applying SDK-level defaults.
Methods
create(invocation_config) staticmethod
Create and normalize an InvocationConfig from a raw dictionary of invocation parameters. The method validates the configuration using the Pydantic model and automatically resolves missing input sources using InputSourceResolver.
Parameters
invocation_config (
dict[str, Any]) A raw dictionary representation of an invocation configuration. Must follow the schema expected byInvocationConfig.
Returns
InvocationConfig A validated and normalized invocation configuration. Any input whose
sourcefield was originallyNonewill have its source inferred based on the provided data (e.g., file path, URL, primitive value).
Raises
pydantic.ValidationError If the provided dictionary does not conform to the
InvocationConfigschema.
ModelFactory
ParameterFactory
Factory responsible for constructing ModelParam objects based on the high-level ParameterConfig specification. The factory resolves the parameter’s declared data encoding into a corresponding DataModality, ensuring consistent interpretation of parameter types across the SDK.
This factory is used during model registration to convert declarative configurations into strongly typed parameter definitions that the system can understand and validate.
Methods
create(parameter_config) staticmethod
Create a ModelParam instance from the provided ParameterConfig. The factory determines the parameter’s modality (Audio, Image, Text, etc.) based on its declared encoding and populates the corresponding ModelParam fields.
Parameters
parameter_config (
ParameterConfig) High-level configuration describing the parameter’s name and declared data encoding (e.g.,"mp3","png","utf-8").
Returns
ModelParam A fully initialized parameter definition containing the parameter name, encoding, and resolved data modality.
Raises
ValueError If the encoding is invalid or cannot be resolved by
ParameterModalityResolver.
SignatureFactory
Factory responsible for constructing ModelSignature objects from the high-level declarative SignatureConfig. The factory resolves encoding, modality, HTTP binding location, parameters, and defaults, producing a strongly typed signature definition used when registering and executing models.
Signatures describe how models receive and produce data, including:
Data modality (audio, text, image, etc.)
Data domain (semantic grouping)
Encoding type
HTTP location (body, query, etc.)
Parameters and sub-fields
Optional metadata such as visibility and default values
Methods
create(signature_config, signature_type) staticmethod
Create a ModelSignature object from a SignatureConfig, assigning the appropriate signature type (input/output) and resolving all fields into their normalized forms.
Behavior Summary
Resolves the signature’s data modality based on the declared encoding using
SignatureModalityResolver.Determines correct
http_location, defaulting toHttpLocation.Bodywhen unspecified.Normalizes
hiddenanddefault_valuefields.Builds signature parameters using
ParameterFactory.Initializes empty transform and argument lists (reserved for future extensibility).
Parameters
signature_config (
SignatureConfig) Declarative configuration describing the signature’s structure, encoding, metadata, and optional parameters.signature_type (
SignatureType) Indicates whether this signature represents a model input or output.
Returns
ModelSignature A fully constructed signature definition describing how a model expects or produces data.
Raises
ValueError If the data encoding is unknown or cannot be resolved.
TagFactory
Factory responsible for constructing ModelTag objects based on a high-level ModelTagConfig. Tags are lightweight metadata elements used to categorize or annotate models in the Norman platform.
The factory automatically injects the authenticated user's account ID into created tags, ensuring proper ownership metadata is preserved.
Methods
create(tag_config) staticmethod
Create a ModelTag instance from the provided configuration, assigning both the tag name and the ID of the authenticated user who owns it.
Parameters
tag_config (
ModelTagConfig) Configuration object describing the tag’s human-readable name.
Returns
ModelTag A fully initialized tag containing the owning user's
account_idand the name specified in the configuration.
Raises
No explicit exceptions are raised by this method, but downstream validation may fail if the configuration contains invalid values.