build_reflection_prompt

Function build_reflection_prompt 

Source
pub fn build_reflection_prompt(
    user_request: &str,
    agent_response: &str,
    quality_signals: &QualitySignals,
    tool_errors: &[String],
) -> String
Expand description

Build the reflection prompt that asks the LLM to analyze a suboptimal turn.

This is the pure prompt-construction step for reflection generation:

  • the original user request becomes the task context,
  • the agent response becomes the failed/suboptimal attempt,
  • tool errors and quality signals become the environment feedback,
  • and the output contract forces the model into the structured ATTEMPT/ISSUE/STRATEGY/TAGS format expected by the parser.