STREAMVIZ DOCUMENTATION
Protocol
Register the model-facing tools and keep visualization authoring rules in sync.StreamViz exposes protocol helpers so the model prompt, tool names, metadata, and renderer cannot drift independently.
Tool sequence
- The model calls
visualize_read_mewith the closest artifact type. - The host returns the packaged authoring rules.
- The model calls
visualize_show_widgetwith loading messages, HTML, and a title. - The host streams the tool arguments to the UI.
- The UI normalizes and renders the evolving
widget_code.
Supported authoring types are diagram, chart, interactive, mockup, and art.
Build the system prompt
tsimport { buildVisualizeSystemPrompt } from 'streamviz-react/protocol'const systemPrompt = [baseSystemPrompt,buildVisualizeSystemPrompt(),].join('\n\n')
Register the tools
tsimport {VISUALIZE_READ_ME_TOOL_NAME,VISUALIZE_SHOW_WIDGET_TOOL_NAME,VISUALIZE_TYPES,} from 'streamviz-react/protocol'
The show-widget input is:
tstype VisualizeWidgetInput = {title: stringwidget_code: stringloading_messages: readonly string[]}
Persist final metadata
tsimport { buildVisualizeWidgetMetadata } from 'streamviz-react/protocol'const metadata = buildVisualizeWidgetMetadata({title,widget_code,loading_messages,})
Persist this metadata with the completed tool result. It gives every client a stable final shape even if the live transport format is provider-specific.
Previous← Security model
NextTheming →