e30e75b5d4
Changesets / Create Version PR (push) Has been cancelled
Deploy Shadcn Registry / Deploy Production (push) Has been cancelled
Template Metrics / LOC + Bundle Size (push) Has been cancelled
Code Quality / Oxlint + Oxfmt (push) Has been cancelled
Code Quality / Template Sync (push) Has been cancelled
Code Quality / Build Changed Packages (push) Has been cancelled
Code Quality / Test Changed Packages (push) Has been cancelled
Deploy Expo Example / Deploy Production (push) Has been cancelled
Deploy Ink Example / Deploy Production (push) Has been cancelled
Python Tests / pytest (assistant-stream, 3.10) (push) Has been cancelled
Python Tests / pytest (assistant-stream, 3.12) (push) Has been cancelled
Python Tests / pytest (assistant-ui-sync-server-api, 3.10) (push) Has been cancelled
Python Tests / pytest (assistant-ui-sync-server-api, 3.12) (push) Has been cancelled
43 lines
1003 B
TypeScript
43 lines
1003 B
TypeScript
"use client";
|
|
|
|
import { Thread } from "@/components/assistant-ui/thread";
|
|
import { ThreadList } from "@/components/assistant-ui/thread-list";
|
|
import { useAui, AuiProvider, Suggestions, Tools } from "@assistant-ui/react";
|
|
import toolkit from "./toolkit";
|
|
|
|
function ThreadWithSuggestions() {
|
|
const aui = useAui({
|
|
tools: Tools({ toolkit }),
|
|
suggestions: Suggestions([
|
|
{
|
|
title: "Check stock price",
|
|
label: "get the latest AAPL snapshot",
|
|
prompt: "What's the current price of AAPL?",
|
|
},
|
|
{
|
|
title: "Buy shares",
|
|
label: "execute a stock purchase",
|
|
prompt: "Buy 10 shares of TSLA.",
|
|
},
|
|
]),
|
|
});
|
|
return (
|
|
<AuiProvider value={aui}>
|
|
<Thread />
|
|
</AuiProvider>
|
|
);
|
|
}
|
|
|
|
export default function Home() {
|
|
return (
|
|
<div className="flex h-dvh">
|
|
<div className="max-w-md">
|
|
<ThreadList />
|
|
</div>
|
|
<div className="flex-grow">
|
|
<ThreadWithSuggestions />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|