ReAct (Yao et al., 2022) interleaves reasoning traces with actions. The model writes a thought, then an action such as Search[query]. The environment answers with an observation, and the loop continues until the model finishes. Parsing the action is the first step of running that loop.
Implement parse_action(text), extracting the action name and its argument from the model output.
Use a regular expression for Action: name[argument], and return the two captured groups.
No results yet
Run your code to check it against the examples, or submit to run every test.