Skip to main content

parse_react_step

Function parse_react_step 

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

Parses a ReAct response string into a ReActStep.

Case-insensitive; tolerates spaces around the colon. e.g. Thought :, thought:, THOUGHT : all match.

Multi-line sections: everything between a Thought: (or Action:) header and the next section header is included verbatim, so JSON arguments that span multiple lines are captured correctly.