AI AssistantNew
Threads, the conversation and a composer, as one workspace.
The Screen
A reading surface with a composer. The thread list sits on the left; the conversation is a reading measure in the middle, with the assistant's answer as markdown, a collapsed tool call, its sources as chips and the message actions beneath; the composer at the bottom owns the one accent on the screen. A turn in progress shows a shimmering label where the answer will be.
Under lg the thread list folds behind a button and the conversation takes the width.
Made Of
- chat-list-view
- chat-conversation
- chat-message
- chat-message-actions
- chat-tool
- chat-source
- chat-loader
- text-shimmer
- markdown
- prompt-input
- prompt-suggestion
Source
Copy the folder into your project. The screen imports @peakui/react, @peakui-pro/react and
its chat-tool and markdown subpaths, @gravity-ui/icons and react, and nothing else. The
thread and the answer live in data.ts; wire PromptInput's onSubmit to your model.
"use client"; // the thread, the composer and the run state are state
import type {Turn} from "./data";
import {Bars, Database, Paperclip} from "@gravity-ui/icons";/*
* The thread behind the assistant screen. The answer is markdown the way a model returns it; the
* tool call and the sources are what a run produces. Replace this with your transport; keep the
* shapes.
*/import {Comment, Plus} from "@gravity-ui/icons";
import {Button, SearchField} from "@peakui/react";
import {ChatListView} from "@peakui-pro/react";
import {THREADS} from "./data";"use client"; // the conversation follows streaming content, which needs the browser
import type {Turn} from "./data";
import {ArrowRotateRight, Copy, ThumbsDown, ThumbsUp} from "@gravity-ui/icons";