Prompts API
Specialty Strategies
cotlab.prompts.RadiologyPromptStrategy
Bases: StructuredOutputMixin, BasePromptStrategy
Structured JSON output for radiology pathological fracture detection.
Uses structured JSON output format with: - Clear step-by-step reasoning instructions - JSON output with fracture_mentioned, pathological_fracture, evidence - Few-shot examples for format guidance
__init__(name='radiology', system_role=None, contrarian=False, few_shot=True, answer_first=False, output_format='json', **kwargs)
build_prompt(input_data)
Build prompt with radiology report.
parse_response(response)
Parse response from model (supports multiple formats).
Expected format: { "fracture_mentioned": bool, "pathological_fracture": bool, "evidence": { "report_findings": [...], "rationale": "..." } }
cotlab.prompts.CardiologyPromptStrategy
Bases: StructuredOutputMixin, BasePromptStrategy
Structured JSON output for paediatric cardiology CHD detection.
Uses structured JSON output format with: - Clear step-by-step reasoning instructions - JSON output with cardiac_abnormality, congenital_heart_defect, evidence - Few-shot examples for format guidance
build_prompt(input_data)
Build prompt with cardiac imaging report.
get_compatible_datasets()
Cardiology prompt is only compatible with cardiology dataset.
This prompt is specifically designed for congenital heart defect detection in cardiac imaging reports and should NOT be used for general medical QA.
get_prediction_field()
Return the JSON field name used for binary classification.
parse_response(response)
Parse response from model (supports multiple formats).
Expected format: { "cardiac_abnormality": bool, "congenital_heart_defect": bool, "evidence": { "report_findings": [...], "rationale": "..." } }
cotlab.prompts.NeurologyPromptStrategy
Bases: StructuredOutputMixin, BasePromptStrategy
Structured JSON output for paediatric neurology abnormality detection.
Uses structured JSON output format with: - Clear step-by-step reasoning instructions - JSON output with imaging_abnormality, neurological_abnormality, evidence - Few-shot examples for format guidance
build_prompt(input_data)
Build prompt with neuroimaging report.
get_compatible_datasets()
Neurology prompt is only compatible with neurology dataset.
get_prediction_field()
Return the JSON field name used for binary classification.
parse_response(response)
Parse response from model (supports multiple formats).
cotlab.prompts.OncologyPromptStrategy
Bases: StructuredOutputMixin, BasePromptStrategy
Structured JSON output for paediatric oncology malignancy detection.
Uses structured JSON output format with: - Clear step-by-step reasoning instructions - JSON output with abnormal_findings, malignancy, evidence - Few-shot examples for format guidance
get_compatible_datasets()
Oncology prompt is only compatible with oncology dataset.
get_prediction_field()
Return the JSON field name used for binary classification.
parse_response(response)
Parse response from model (supports multiple formats).