walnutwaldo / enhanceai-react

React wrapper for EnhanceAI (enhanceai.dev), a library for enhancing web app text input with AI autocomplete.
MIT License
188 stars 8 forks source link

Initialise with a context #2

Closed sadaqabdo closed 1 year ago

sadaqabdo commented 1 year ago

Hello,

I really liked the idea, great work. However, I suggest to have an option to start with a predefined context.

Let's say for example I have a search bar that destined to search for Movies.

<EnhanceAI context='Pulp Fiction, Dunkirk, Split'>
        <searchbar >
</EnhanceAI>

so I will expect the first suggestion to have when I type for example: 'Spi' -> 'Spiderman'

I hope the idea is clear, and it would be a great addition.

Thanks

sadaqabdo commented 1 year ago

I think you already took care of it, great job.

https://github.com/walnutwaldo/enhanceai-react/blob/6b4be57e7bce9461425a7fe9bbda21e8103885fa/src/lib/components/EnhanceAI.tsx#L5