본문으로 건너뛰기
AI NEWS JOURNAL
VercelAI NEWS / JOURNAL

Chat SDK agents can now stream generative UI with json-render

Vercel introduces json-render, enabling Chat SDK agents to generate and stream interactive UI components as JSON specs, which are converted into platform-native cards (e.g., Block Kit on Slack, Adaptive Cards on Teams). The system uses a typed component catalog covering tables, charts, buttons, and more, eliminating the need for separate tools. It supports streaming updates with real-time edits every 500 ms, validates component specs against schemas, and enforces platform-specific message limits to prevent content degradation.

번역 서비스가 일시 중지되어 원문을 표시합니다.

You can now stream generative UI from your Chat SDK agent with json-render. With a typed catalog of components, the agent writes a JSON spec that json-render converts into a Chat SDK card. Each adapter then posts the card in its platform’s native format, such as Block Kit on Slack and Adaptive Cards on Teams. The catalog covers tables, charts, buttons, and more, so there’s no separate tool to build and maintain for each message shape. import { defineCatalog } from "@json-render/core";import { schema, standardComponentDefinitions, streamCard,} from "@json-render/chat";import { streamText } from "ai"; const catalog = defineCatalog(schema, { components: standardComponentDefinitions,}); bot.onNewMention(async (thread, message) => { const result = streamText({ model: "anthropic/claude-haiku-5.5", system: catalog.prompt(), prompt: message.text, }); await streamCard(thread, result.textStream);}); Stream a generated card into the thread when your agent is mentioned. Copy link to headingStream cards as the model writes streamCard posts the card once its root element has content and updates the message as new elements stream in. Edits go out at most once every 500 ms by default, which matches Chat SDK’s streaming interval. Once the stream ends, the message shows the final, validated card. Copy link to headingValidate specs and enforce platform limits toCard checks every element’s props against its component schema and throws CardSpecError for an invalid spec. Each problem gets its own readable issue, so you can send the list back to the model for a corrected spec. Platforms cap what a single message can hold, and Chat SDK adapters degrade content past those caps. The Slack adapter, for example, turns a second table into a code block. Pass limits to reject those specs instead. Read the documentation to get started, or try the playground. Contributors Chris Tate

자료 출처

원문 읽기 ↗

관련 주제

← 전체 소식 이어 읽기