Artificial intelligence applications have hit like a massive wave over this past year, with ChatGPT being the most prominent. ChatGPT can take any written command and suggest content to match. What better than having the power of AI content creation than doing so within your own WYSIWYG editor! That’s what Froala can provide you — […] The post ChatGPT via WYSIWYG (Sponsored) appeared first on David Walsh Blog. Artificial intelligence applications have hit like a massive wave over this past year, with ChatGPT being the most prominent. ChatGPT can take any written command and suggest content to match. What better than having the power of AI content creation than doing so within your own WYSIWYG editor! That’s what Froala can provide you — instant content creation with the power and intelligence of ChatGPT AI! Quick Hits The ChatGPT plugin can be installed in your WYSIWYG editorType a command, highlight that text, click the ChatGPT button, and wait for the response!Help with content creation makes the written experience more enjoyable and the generated content more creativeEasy to implement from a technical perspective! Implementing ChatGPT AI into Froala Adding ChatGPT capability into your Froala WYSIWYG instance is really simple. Start by adding the button, registering the command, and adding it into the toolbar: // Add the icon to the Chat GPT UI FroalaEditor.DefineIcon(‘chatGPT’, { NAME: ‘help’, SVG_KEY: ‘help’ }); // Register its functionality FroalaEditor.RegisterCommand(‘chatGPT’, { title: ‘Ask ChatGPT’, focus: false, undo: false, refreshAfterCallback: false, callback: async function callback() { const CHAT_GPT_KEY = ‘YOUR API KEY HERE’; const data = { model: ‘text-davinci-003’, prompt: this.selection.text(), max_tokens: 256, temperature: 0, }; // Make the API call to ChatGPT const response = await fetch(‘https://api.openai.com/v1/completions’, { method: ‘post’, headers: { ‘Content-Type’: ‘application/json’, Authorization: `Bearer ${CHAT_GPT_KEY}` }, body: JSON.stringify(data) }); const { choices } = await response.json(); // Insert the suggestion into selected text this.html.insert(choices[0].text); } }); // Add ChatGPT to the toolbar during initialization new FroalaEditor(‘#editor’, { toolbarButtons: [[‘undo’, ‘redo’, ‘bold’], [‘chatGPT’]] }); That’s all it takes to implement an incredible, powerful AI into your WYSIWYG editor! ChatGPT and Froala in Tandem Froala, the next generation WYSIWYG editor, is a perfect host for ChatGPT AI. Content creation is difficult, especially if you’ve run into writer’s block or simply want a better way to express your idea. Since ChatGPT is so smart, it can act as a thesaurus, dictionary, and writing partner all at once. Use cases for ChatGPT in your WYSIWYG might include: Rewording a sentence to improve creativity in the contentAsking a question to cut down on manual researchGetting a definition for a word you may not knowGetting translations for another languageMany more possibilities! Building Smarter Interfaces By incorporating ChatGPT AI into your WYSIWYG content editor, you’re able to build smarter content, applications, and interfaces. How? By asking ChatGPT to incorporate imagery, videos, and even embeddable HTML snippets. Take the following text example: For example, this is what a healthy dog looks like: Fetch a picture of a healthy dog
software-services
No responses yet