models
models
¶
Core data models for autochecklist.
ChecklistItemAnswer
¶
ConfidenceLevel
¶
Bases: str, Enum
Confidence levels for normalized scoring (RocketEval-style).
Source code in autochecklist/models.py
ChecklistItem
¶
Bases: BaseModel
A single checklist item (yes/no question).
Source code in autochecklist/models.py
Checklist
¶
Bases: BaseModel
A collection of checklist items.
Source code in autochecklist/models.py
by_category()
¶
Group items by category, returning a dict of sub-checklists.
Items with category=None are placed under "ungrouped".
Key order matches the first occurrence of each category.
Source code in autochecklist/models.py
save(path)
¶
load(path)
classmethod
¶
to_text(numbered=True)
¶
Format checklist as text for prompts.
Source code in autochecklist/models.py
ItemScore
¶
Bases: BaseModel
Score for a single checklist item.
Source code in autochecklist/models.py
Score
¶
Bases: BaseModel
Complete scoring result.
Source code in autochecklist/models.py
pass_rate
property
¶
Proportion of items answered 'yes'.
primary_score
property
¶
Returns whichever metric the pipeline designated as primary.
scaled_score_1_5
property
¶
Scale pass_rate to 1-5 range (InteractEval style).
Formula: score = pass_rate * 4 + 1 - pass_rate=0.0 → score=1.0 - pass_rate=0.5 → score=3.0 - pass_rate=1.0 → score=5.0
GroupedScore
¶
Bases: BaseModel
Scoring result grouped by category (e.g., per-dimension scores).
Produced when scoring sub-checklists from Checklist.by_category().
Source code in autochecklist/models.py
per_group_pass_rates
property
¶
Pass rate for each category.
pass_rate
property
¶
Macro-averaged pass rate (each category weighted equally).
micro_pass_rate
property
¶
Micro-averaged pass rate (pooled across all items).
mean_score
property
¶
Mean of Score.primary_score across all categories.
flatten()
¶
Merge all sub-scores into a single Score.
Source code in autochecklist/models.py
FeedbackInput
¶
Bases: BaseModel
Input for feedback-based checklist generation.
Source code in autochecklist/models.py
DeductiveInput
¶
Bases: BaseModel
Input for deductive (dimension-based) generation (CheckEval, InteractEval).
Source code in autochecklist/models.py
InteractiveInput
¶
Bases: BaseModel
Input for interactive (think-aloud based) generation (InteractEval).
Source code in autochecklist/models.py
GeneratedQuestion
¶
GeneratedWeightedQuestion
¶
ChecklistResponse
¶
WeightedChecklistResponse
¶
GeneratedCategorizedQuestion
¶
Bases: GeneratedQuestion
A generated yes/no question with a category label.
Source code in autochecklist/models.py
CategorizedChecklistResponse
¶
Bases: BaseModel
LLM response schema for categorized checklist generation (OpenRubrics CRG).
Source code in autochecklist/models.py
BatchAnswerItem
¶
BatchScoringResponse
¶
BatchAnswerItemReasoned
¶
Bases: BaseModel
A single answer with reasoning in batch scoring (1-based question index).
Source code in autochecklist/models.py
BatchScoringResponseReasoned
¶
ItemScoringResponse
¶
ItemScoringResponseReasoned
¶
to_response_format(model_cls, name)
¶
Convert a Pydantic model class to an OpenAI-compatible response_format dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_cls
|
type[BaseModel]
|
Pydantic model class defining the JSON schema. |
required |
name
|
str
|
Name for the schema (e.g., "checklist_response"). |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Dict suitable for passing as |
dict
|
The schema is post-processed for OpenAI strict mode compatibility. |