cursus.steps.configs.config_slipbox_knowledge_routing_step¶
Slipbox Knowledge Routing Configuration with Self-Contained Derivation Logic
This module implements the configuration class for the SageMaker Processing step that hosts the DKS knowledge+ruleset corpus and runs the internal compile → index → route pipeline (see FZ 29h1e §4/§7).
Fields are categorized according to the three-tier design used across cursus processing configs: 1. Essential User Inputs (Tier 1) - Required fields that must be provided by users 2. System Fields (Tier 2) - Fields with reasonable defaults that can be overridden 3. Derived Fields (Tier 3) - Fields calculated from other fields, private with
read-only property access
The env-var names declared by slipbox_knowledge_routing.step.yaml resolve by
the single-source convention (NAME -> self.name); each optional env var has
a matching lower-cased field here so get_environment_variables can resolve it:
ROUTING_SCORING_MODE <- self.routing_scoring_mode ROUTING_THRESHOLD <- self.routing_threshold ROUTING_TOP_K <- self.routing_top_k ROUTING_ENCODE_BATCH_SIZE <- self.routing_encode_batch_size ROUTING_NUM_THREADS <- self.routing_num_threads EMBEDDING_MODEL_NAME <- self.embedding_model_name
- class SlipboxKnowledgeRoutingConfig(*, author, bucket, role, region, service_name, pipeline_version, model_class='xgboost', current_date=<factory>, framework_version='2.1.0', py_version='py310', image_uri=None, subnets=None, security_group_ids=None, enable_network_isolation=None, source_dir=None, enable_caching=False, use_secure_pypi=False, max_runtime_seconds=172800, project_root_folder, processing_instance_count=1, processing_volume_size=500, processing_instance_type_large='ml.m5.4xlarge', processing_instance_type_small='ml.m5.2xlarge', use_large_processing_instance=True, skip_volume_kms=None, processing_source_dir=None, processing_entry_point='slipbox_knowledge_routing.py', processing_script_arguments=None, processing_framework_version='1.2-1', job_type='training', routing_scoring_mode='activation', routing_threshold=0.3, routing_top_k=7, embedding_model_name='all-MiniLM-L6-v2', routing_encode_batch_size=256, routing_num_threads=0, default_corpus_vault='', default_prompts_dir='', routing_index_path='/tmp/pattern_routing_index.pkl', use_bundled_corpus=True, **extra_data)[source]¶
Bases:
ProcessingStepConfigBaseConfiguration for the Slipbox Knowledge Routing step with three-tier field categorization. Inherits from ProcessingStepConfigBase (same base as the TabularPreprocessing exemplar).
Fields are categorized into: - Tier 1: Essential User Inputs - Required from users - Tier 2: System Fields - Default values that can be overridden - Tier 3: Derived Fields - Private with read-only property access
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod validate_entry_point_relative(v)[source]¶
Ensure processing_entry_point is a non-empty relative path.
- classmethod validate_job_type(v)[source]¶
Ensure job_type is lowercase alphanumeric (with underscores).
- classmethod validate_scoring_mode(v)[source]¶
Ensure routing_scoring_mode is one of the allowed values (case-insensitive).
- classmethod validate_embedding_model_name(v)[source]¶
Ensure embedding_model_name is a non-empty string.
- get_environment_variables()[source]¶
Environment variables for the slipbox knowledge routing script.
Explicitly emits USE_SECURE_PYPI (a BasePipelineConfig field) so the container’s pip-install step can authenticate to the secure CodeArtifact PyPI index inside a restricted VPC — this is REQUIRED because the step interface’s declared env_vars list does not include USE_SECURE_PYPI, so the interface-driven base resolver never emits it (the container would otherwise see the default false and skip the secure index). Mirrors the pytorch model-eval config, which overrides this method for the same reason.
Also emits the routing knobs explicitly (rather than leaning on the NAME->self.name convention) so the full env is self-contained and independent of the interface’s declared-key set.
- get_public_init_fields()[source]¶
Override get_public_init_fields to include slipbox knowledge routing specific fields.
- Returns:
Dictionary of field names to values for child initialization
- Return type:
Dict[str, Any]
- model_post_init(context, /)¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (BaseModel) – The BaseModel instance.
context (Any) – The context.