import { useState } from "react"; import type { Message } from "ai/react"; export function IntermediateStep(props: { message: Message }) { const parsedInput = JSON.parse(props.message.content); const action = parsedInput.action; const observation = parsedInput.observation; const [expanded, setExpanded] = useState(false); return (
setExpanded(!expanded)} > 🛠 {action.name} 🔽 🔼
Tool Input:



{JSON.stringify(action.args)}
{observation}
); }