michael / editable-website

A SvelteKit template for building CMS-free editable websites
https://editable.website
MIT License
1.34k stars 103 forks source link

Introduce AI generate tool #5

Closed nilskj closed 1 year ago

nilskj commented 1 year ago

This PR adds a little button that can help re-iterate or generate copy for text fields using ChatGPT.

Since it is using the context of the selected text, it is disabled if no text is selected:

image

When opened a modal appears where user can ask for a completion or generate something creative:

image

It then replaces the selected text with result from OpenAI chat /completions API ✨

image

You will need to provide your OpenAI key in .env. This is mostly just to showcase some of the possibilities with this template and is not a must have feature. Quite cool though 😎

michael commented 1 year ago

Really cool. Finally I get to see ChatGPT integration code. ;)

I have a request: Could you maintain this code in your fork and instead add a section "Examples" to the README with a bullet point "ChatGTP integration" linking to your forked repo?

I'd like to keep the base template as simple as possible so it's quick to setup but it'd be great to link to variations of the template. Thanks for adding MinIO setup instructions! 🙏

nilskj commented 1 year ago

Closing, adding this as an example of "ChatGTP integration" to the README in a new PR instead of merging this.