p2_classification_runner¶
UC1-P2 classification runner — classify line of business from P1 extraction output.
- class prompt_risk.uc.uc1.p2_classification_runner.P2ClassificationUserPromptData(*, extraction_json: str)[source]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class prompt_risk.uc.uc1.p2_classification_runner.P2ClassificationOutput(*, line_of_business: Literal['auto', 'property', 'workers_comp', 'general_liability', 'marine', 'cyber', 'other'], confidence: Literal['high', 'medium', 'low'], reasoning: str, secondary_lob: Literal['auto', 'property', 'workers_comp', 'general_liability', 'marine', 'cyber', 'other', 'none'], field_conflicts: list[str], escalate: bool)[source]¶
Structured output for the P2 LoB classification prompt.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- prompt_risk.uc.uc1.p2_classification_runner.MAX_RETRIES = 3¶
Maximum number of converse API calls per
run_p2_classification()invocation.
- prompt_risk.uc.uc1.p2_classification_runner.run_p2_classification(client: BedrockRuntimeClient, data: P2ClassificationUserPromptData, prompt_version: str = '01', model_id: str = 'us.amazon.nova-2-lite-v1:0') P2ClassificationOutput[source]¶
Execute the P2 classification prompt and return validated output.
Takes the structured JSON output from P1 extraction and classifies the claim’s line of business.
Uses the same system-prompt caching and retry-on-validation-failure pattern as
run_p1_extraction().