import { useState } from "react"; import { askAI } from "../utils/askAI"; export default function ChatBot() { const [question, setQuestion] = useState(""); const [response, setResponse] = useState(""); const handleAsk = async () => { if (!question) return; const aiResponse = await askAI(question); setResponse(aiResponse); }; return (

Chat avec l'IA

setQuestion(e.target.value)} /> {response &&

Réponse : {response}

}
); }