@copilotkit/runtime
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
40 lines (29 loc) • 895 B
Markdown
LlamaIndex — wired via `@ag-ui/llamaindex`. Requires a `/run` URL suffix.
## Install
```bash
pnpm add @ag-ui/llamaindex
```
## Minimal wire-up
```typescript
import {
CopilotRuntime,
createCopilotRuntimeHandler,
} from "@copilotkit/runtime/v2";
import { LlamaIndexAgent } from "@ag-ui/llamaindex";
const runtime = new CopilotRuntime({
agents: {
default: new LlamaIndexAgent({
url: process.env.LLAMAINDEX_URL ?? "http://localhost:8000/run",
}),
},
});
const handler = createCopilotRuntimeHandler({
runtime,
basePath: "/api/copilotkit",
});
export default { fetch: handler };
```
## Gotcha — the `/run` suffix is mandatory
LlamaIndex's AG-UI adapter mounts its workflow endpoint at `/run`. Pointing `url` at the
server root (`http://localhost:8000`) returns 404. Always include `/run`.
Source: `docs/content/docs/integrations/llamaindex/quickstart.mdx:258`.