Skip to content

Commit 64ffb9b

Browse files
committed
feat(example): update react-router example to test multimodal attachments
1 parent 1603b63 commit 64ffb9b

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

examples/v2/react-router/app/routes/_index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ export default function Index() {
55
return (
66
<CopilotKitProvider runtimeUrl="/api/copilotkit" showDevConsole="auto">
77
<div className="h-screen w-screen">
8-
<CopilotChat className="h-full w-full" />
8+
<CopilotChat
9+
className="h-full w-full"
10+
attachments={{ enabled: true }}
11+
/>
912
</div>
1013
</CopilotKitProvider>
1114
);

examples/v2/react-router/app/server.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,14 @@ import {
44
createCopilotEndpoint,
55
InMemoryAgentRunner,
66
} from "@copilotkit/runtime/v2";
7-
import { chat } from "@tanstack/ai";
8-
import { openaiText } from "@tanstack/ai-openai";
9-
import { TanStackAIAgent } from "./agent";
7+
import { BuiltInAgent } from "@copilotkit/runtime/v2";
108

119
export default await createHonoServer({
1210
configure(app) {
13-
const agent = new TanStackAIAgent(
14-
({ messages, systemPrompts, abortController }) =>
15-
chat({
16-
adapter: openaiText("gpt-4o"),
17-
messages,
18-
systemPrompts,
19-
abortController,
20-
}),
21-
);
11+
const agent = new BuiltInAgent({
12+
model: "openai/gpt-4o",
13+
prompt: "You are a helpful assistant. When the user sends images or files, describe what you see or analyze the content.",
14+
});
2215

2316
const runtime = new CopilotRuntime({
2417
agents: { default: agent },

0 commit comments

Comments
 (0)