Select the text and click the sparkles button on the toolbar or the '+' (plus) button to start interacting with AI.
<!DOCTYPE html>
<html>
<head>
<title>Redactor</title>
<meta charset="utf-8">
<!-- css -->
<link rel="stylesheet" href="/your-folder/redactor.css" />
</head>
<body>
<!-- element -->
<textarea id="entry">...</textarea>
<!-- js -->
<script src="/your-folder/redactor.js"></script>
<script src="/your-folder/plugins/ai/ai.js"></script>
<!-- call -->
<script>
Redactor('#entry', {
plugins: ['ai'],
ai: {
text: {
url: '/path-to-server-side/',
endpoint: 'https://api.openai.com/v1/chat/completions',
model: 'gpt-4o',
stream: true
},
image: {
url: '/path-to-server-side/',
endpoint: 'https://api.openai.com/v1/images/generations',
model: 'dall-e-3'
}
}
});
</script>
</body>
</html>