Spaces:
Running
Running
Chat Context
AI chat interface with real-time streaming.
Components
ChatPanel.svelte- Main chat UI with smooth scroll and keyed message iterationMessageSegment.svelte- Renders text, tool invocations, and resultsStreamingText.svelte- Optimized character streaming with state persistenceToolInvocation.svelte- Consolidated tool execution and results displayInProgressBlock.svelte- Status indicator with progress barReasoningBlock.svelte- Auto-collapsing thinking viewerMarkdownRenderer.svelte- Markdown parser with configurable streaming speedToolCallDisplay.svelte,ToolCallBlock.svelte- Legacy tool rendering (deprecated)
Architecture
- Explicit message IDs with proper component keying
- StreamingText tracks processed content length to prevent duplication
- Batch character processing (3 chars/cycle) at 120 chars/sec
- Tool invocations and results merged in single visual blocks
- Segments keyed by ID for stable component identity