Dynamic AI prompts #4583
Replies: 1 comment
-
Hi @leosilberg! I'm Dosu and I’m helping the plate team. For injecting external context into AI Kit prompts, using a zustand store (or any external state management) is usually the simplest and most flexible approach. You can access your external state directly inside your promptTemplate or getPrompt function, just like in your example. This pattern is supported and works well for non-editor context. PlateController is mainly for accessing Plate editor state from outside the editor tree, not for arbitrary app context. If your context isn't tied to the editor's internal state, you don't need to wrap your tree in PlateController—zustand or React context is easier and more direct for this use case. See the official docs for more on customizing prompts and context: To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to add context from outside the plate editor to the ai kit prompts , what is the best way to do this? Do I need to wrap the component tree in a PlateController or is it easier to use a zustand store ?
Beta Was this translation helpful? Give feedback.
All reactions