Parsing a ReAct Action

~10 mincode completion

Implement parse_action(line) returning the list [tool, argument].

Where this shows up

~10 min

3 employers weight this skill

2 frontier labs, 1 AI product company. Top match scores 80.

Python
def parse_action(line):
    """
    Split a ReAct action line into its tool name and argument.

    Args:
        line: string like "Action: search[some query]"

    Returns:
        list of two strings: [tool, argument]
    """
    # YOUR CODE HERE
    pass

Run your code to see results

⌘↵ runs against the visible tests

Loading docs…

The AI Mentor needs an account

It reads your code and the failing tests and nudges you toward the fix without handing you the answer. Free accounts get it on every problem you're working on today.