Skip to content

Instantly share code, notes, and snippets.

@gnfisher
gnfisher / prompt.txt
Created October 18, 2024 19:15 — forked from philschmid/prompt.txt
CoT & Reasoning Prompt
Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches.
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed.
Use <count> tags after each step to show the remaining budget. Stop when reaching 0.
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress.
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process.
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach:
0.8+: Continue current approach
0.5-0.7: Consider minor adjustments
Below 0.5: Seriously consider backtracking and trying a different approach
map2 : (a -> b -> c) -> Validatable a -> Validatable b -> Validatable c
map2 func v1 v2 =
case ( v1, v2 ) of
( Invalid a fatal warnings, Valid b ) ->
Invalid (func a b) fatal warnings
( Invalid a fa wa, Warnings b wb ) ->
Invalid (func a b) fa (wa ++ Nonempty.toList wb)
( Invalid a fa wa, Invalid b fb wb ) ->