prompts
Centralized prompt templates for GenAI calls.
Internal; no stability guarantees
Each builder returns a PromptInfo with the prompt text, a semantic version, and an opaque content hash to aid logging and reproducibility.
PromptInfo
Bases: BaseModel
Structured metadata for a prompt template.
Frozen/immutable to ensure prompts are treated as value objects and can be safely logged and hashed without mutation.
morphosyntax_prompt
Build the morphosyntax prompt.
Rules emphasize strict UD tags, no commentary, and TSV in a code block.
Source code in cltk/genai/prompts.py
dependency_prompt_from_tokens
Build a dependency prompt using an existing token table.
The table must be TSV with header: INDEX, FORM, UPOS, FEATS.
Source code in cltk/genai/prompts.py
dependency_prompt_from_text
Build a dependency prompt when no token table is available.
Source code in cltk/genai/prompts.py
enrichment_prompt
Build the enrichment prompt that consumes morph+dependency tokens.
Source code in cltk/genai/prompts.py
translation_prompt
Build a translation prompt that leverages prior annotations.