Extractor: Advanced Assessment Needed¶
Module: app.extractors.advanced_assessment_needed.models¶
Structured schema for the advanced_assessment_needed extractor.
- Authors:
Roger Erismann (https://hammerdirt.solutions), OpenAI Codex
- Purpose:
Defines the validated response contract used by the extractor registry for the
advanced_assessment_neededsection.- Dependencies:
pydantic.Field (and constrained types where needed) for field metadata and schema generation
StrictBaseModelfor strict validation and OpenAI schema compatibility rules
Notes
This model is consumed by app.extractors.registry.run_extraction
and merged into draft/final form payloads by server round/final flows.
- class app.extractors.advanced_assessment_needed.models.AdvancedAssessmentNeededExtraction(*, section_id='advanced_assessment_needed', needed=None)[source]¶
Bases:
StrictBaseModelStructured extraction payload for advanced assessment requirement.
- Parameters:
section_id (Literal['advanced_assessment_needed'])
needed (Literal['no', 'yes'] | None)
- section_id¶
Fixed section key used by registry routing and downstream merge logic.
- Type:
Literal[‘advanced_assessment_needed’]
- needed¶
One of
"yes"or"no"when stated in transcript;Nonewhen not stated.- Type:
Literal[‘no’, ‘yes’] | None
- Validation:
Extra keys are rejected by
StrictBaseModel.neededis constrained to the allowed literal values.
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'json_schema_extra': <function _enforce_openai_schema>}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'needed': FieldInfo(annotation=Union[Literal['no', 'yes'], NoneType], required=False, default=None, description='Advanced assessment needed if stated: yes or no.'), 'section_id': FieldInfo(annotation=Literal['advanced_assessment_needed'], required=False, default='advanced_assessment_needed', description='Section identifier for this extraction.')}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
Module: app.extractors.advanced_assessment_needed.extractor¶
Typed extractor wrapper for advanced_assessment_needed.
- Authors:
Roger Erismann (https://hammerdirt.solutions), OpenAI Codex
- Purpose:
Provides a section-specific entry point that delegates extraction to the central registry while preserving concrete return typing for callers and documentation.
- Dependencies:
app.extractors.registry.run_extractionfor shared extraction flowAdvancedAssessmentNeededExtractionfor output validation and typing
- Data flow:
transcript (str) -> registry -> Outlines/OpenAI -> validated model object
- app.extractors.advanced_assessment_needed.extractor.run_advanced_assessment_needed_extraction(transcript)[source]¶
Run extraction for advanced-assessment-needed intent.
- Parameters:
transcript (str) – Section transcript text to parse.
- Returns:
Parsed
AdvancedAssessmentNeededExtractionpayload.- Raises:
KeyError – If section id is not registered.
ValueError – If transcript is empty.
RuntimeError – If OpenAI configuration is missing.
- Return type: