本页还没有译文
本页 6 段还没译成Deutsch,下面显示的是英文原文。Chat UI recipes
还没翻译译自英文(tanstack.com)本页 6 段都还没译
Five short examples. Each one adds a single thing to the one before it.
Start with the first if you have not built a chat here yet.
- A chat box with no tools. A layout, a message, and a text part. Nothing else.
- Make a tool look right. Register one tool and branch on its state, so it never shows raw JSON.
- Ask before a tool runs. Gate a tool behind a yes or no, next to the tool or in a list.
- Ask the user your own question. Define an interrupt with your own schemas and render it.
- Send the current user to the server. Pass a tenant or user id per request, out of the prompt.
The code is React. The Solid, Vue, Svelte, and Remix guides use the same option groups and the same component names, so each example maps across with only the framework syntax changing.
For the full component map in one place, see the React guide.
AI 翻译查看英文原文