File tree Expand file tree Collapse file tree
examples/v2/react-router/app Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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
119export 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 } ,
You can’t perform that action at this time.
0 commit comments