PeakUIPro

AI AssistantNew

Threads, the conversation and a composer, as one workspace.

Open full screen

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

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.

ai-assistant/template.tsx
"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";
ai-assistant/data.ts
/*
 * 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.
 */
ai-assistant/thread-list.tsx
import {Comment, Plus} from "@gravity-ui/icons";
import {Button, SearchField} from "@peakui/react";
import {ChatListView} from "@peakui-pro/react";

import {THREADS} from "./data";
ai-assistant/conversation.tsx
"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";

On this page