Priority

Control where a prompt section is placed relative to other sections.

Usage

Source

Priority

PromptBuilder uses priority levels to order sections so that the most important content lands in the regions of the prompt where LLM attention is strongest (typically the beginning and end). Assign a priority when calling builder methods such as structured_section() or when constructing a PromptSection directly.

Values

  • CRITICAL: placed at the very front of the prompt for maximum attention
  • HIGH: placed early, right after critical sections
  • MEDIUM: placed in the middle of the prompt (the default for most builder methods)
  • LOW: placed toward the end for supporting or secondary information

Examples

import talk_box as tb

builder = (
    tb.PromptBuilder()
    .persona("analyst", "data analysis")
    .structured_section(
        "Key Constraints",
        ["Use only public data", "Cite sources"],
        priority=tb.Priority.CRITICAL,
    )
)
print(str(builder)[:100])
You are a analyst with expertise in data analysis.

KEY CONSTRAINTS:
- Use only public data
- Cite s