cursus.steps.scripts.bedrock_prompt_template_generation¶
Bedrock Prompt Template Generation Script
Generates structured prompt templates for categorization and classification tasks following the 5-component architecture pattern for optimal LLM performance.
- class PlaceholderResolver(categories, schema=None)[source]¶
Bases:
objectResolves placeholders marked with ${} syntax from various data sources. Tracks placeholder resolution and validates completion.
Connects category definitions to output format through schema enrichment.
- class PromptTemplateGenerator(config, schema_template=None)[source]¶
Bases:
objectGenerates structured prompt templates for classification tasks using the 5-component architecture pattern.
- class TemplateValidator(validation_level='standard')[source]¶
Bases:
objectValidates generated prompt templates for quality and completeness.
- load_config_from_json_file(config_path, config_name, default_config, log)[source]¶
Load configuration from JSON file with fallback to defaults.
- load_category_definitions(prompt_configs_path, log)[source]¶
Load category definitions from prompt configs directory.
- main(input_paths, output_paths, environ_vars, job_args, logger=None)[source]¶
Main logic for prompt template generation, refactored for testability.
- Parameters:
input_paths (Dict[str, str]) – Dictionary of input paths with logical names
output_paths (Dict[str, str]) – Dictionary of output paths with logical names
environ_vars (Dict[str, str]) – Dictionary of environment variables
job_args (Namespace) – Command line arguments
logger (Callable[[str], None] | None) – Optional logger object (defaults to print if None)
- Returns:
Dictionary containing generation results and statistics
- Return type: