AIButton
You can simply use the <AIButton />
this way
import AIButton from "components";
const ExamplePage = () => {
return (
<AIButton
// give open ai some context on what you are generating initially
defaultPrompt={"article on a pro developer"}
// add some predefined prompts if you like
predefinedPrompts={[
{
label: "Act as a pro",
value: "you are a pro developer generate ....",
},
]}
// (true/false) close the dialog after accepting response
closeOnAccept
// (true/false) reset the form after accepting response
resetOnAccept
onAccept={(data) => {
const { content, htmlContent } = data;
// do something with the last generated response
// e.g. add it to a textarea or input
}}
/>
);
};
export default ExamplePage;