langchain/agents/chat/output_parser.py/ChatOutputParser/parse
class ChatOutputParser:    def parse(self, text: str) -> Union[AgentAction, AgentFinish]:
        if FINAL_ANSWER_ACTION in text:
            return AgentFinish(
                {"output": text.split(FINAL_ANSWER_ACTION)[-1].strip()}, text
            )
        try:
            action = text.split("```")[1]
            response = json.loads(action.strip())
            return AgentAction(response["action"], response["action_input"], text)

        except Exception:
            raise OutputParserException(f"Could not parse LLM output: {text}")