Skip to main content

parse_react_step

Function parse_react_step 

Source
pub fn parse_react_step(response: &str) -> Result<ReActStep, AgentError>
Expand description

Parses a raw LLM response string into a ReActStep.

Supported formats:

  • Thought: <text>
  • Action: <tool_name>(<input>)
  • Action: <tool_name>: <input>
  • Final Answer: <text>

ยงErrors

Returns AgentError::ParseError if the response does not match any known prefix.