Skip to main content

Required Templates

Python and TypeScript Agent both require:
  • planPrompt
  • reasonPrompt
  • actPrompt

Supported Placeholders

  • {goal}
  • {examples}
  • {plan}
  • {observation}
  • {reasoning}
  • {history}

Template Guidance

  • Keep plan concise and structured.
  • Keep reason focused on current observation and progress.
  • Keep act strict: ask for a single action/command.

Minimal Set

PLAN: Goal: {goal}\nExamples:\n{examples}\nCreate a short numbered plan.

REASON: Goal: {goal}\nPlan: {plan}\nObservation: {observation}\nHistory:\n{history}\nExamples:\n{examples}\nThink step by step.

ACT: Goal: {goal}\nPlan: {plan}\nReasoning: {reasoning}\nObservation: {observation}\nRespond with one action only.

Python Unified XML Mode

Python ReActLoop detects XML-style prompts when plan_prompt includes markers like <keystrokes or <response>. In that mode, reasoning/commands are parsed from model XML output. Use this only if your environment expects XML-structured actions.