Skip to content

Commit 74dfd09

Browse files
tylerslatonclaude
andcommitted
fix(docs): update shared snippets to correct V2 API patterns
- CopilotKit imports changed to V1 path (@copilotkit/react-core) - useDefaultTool renamed to useDefaultRenderTool Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d6db65a commit 74dfd09

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/snippets/landing-code-showcase.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { MessageSquare, Layers, Code, Bot, Server, BookOpen, Play, Book } from "
99
]}>
1010
<CodePanel>
1111
```tsx title="app.tsx"
12-
import { CopilotKit } from "@copilotkit/react-core/v2";
12+
import { CopilotKit } from "@copilotkit/react-core";
1313
import { CopilotSidebar } from "@copilotkit/react-core/v2";
1414
import "@copilotkit/react-ui/v2/styles.css";
1515

docs/snippets/shared/guides/default-tool-rendering.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
`useDefaultTool` provides a catch-all renderer for **any tool** that doesn't have a specific `useRenderToolCall` defined. This is useful for:
1+
`useDefaultRenderTool` provides a catch-all renderer for **any tool** that doesn't have a specific `useRenderToolCall` defined. This is useful for:
22

33
- Displaying all tool calls during development
44
- Rendering MCP (Model Context Protocol) tools
55
- Providing a generic fallback UI for unexpected tools
66

77
```tsx title="app/page.tsx"
8-
import { useDefaultTool } from "@copilotkit/react-core/v2"; // [!code highlight]
8+
import { useDefaultRenderTool } from "@copilotkit/react-core/v2"; // [!code highlight]
99
// ...
1010

1111
const YourMainContent = () => {
1212
// ...
1313
// [!code highlight:15]
14-
useDefaultTool({
14+
useDefaultRenderTool({
1515
render: ({ name, args, status, result }) => {
1616
return (
1717
<div style={{ color: "black" }}>
@@ -31,7 +31,7 @@ const YourMainContent = () => {
3131
```
3232

3333
<Callout type="info">
34-
Unlike `useRenderToolCall`, which targets a specific tool by name, `useDefaultTool` catches **all** tools that don't have a dedicated renderer.
34+
Unlike `useRenderToolCall`, which targets a specific tool by name, `useDefaultRenderTool` catches **all** tools that don't have a dedicated renderer.
3535
</Callout>
3636

3737
<Callout type="info">

docs/snippets/shared/premium/observability.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Track user interactions and chat events with comprehensive observability hooks:
2121

2222
```tsx
2323
import { CopilotChat } from "@copilotkit/react-core/v2";
24-
import { CopilotKit } from "@copilotkit/react-core/v2";
24+
import { CopilotKit } from "@copilotkit/react-core";
2525

2626
export default function App() {
2727
return (
@@ -68,7 +68,7 @@ export default function App() {
6868
Monitor system errors and performance with error observability hooks:
6969

7070
```tsx
71-
import { CopilotKit } from "@copilotkit/react-core/v2";
71+
import { CopilotKit } from "@copilotkit/react-core";
7272

7373
export default function App() {
7474
return (

docs/snippets/shared/reference/copilotkit-component.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This component will typically wrap your entire application (or a sub-tree of you
1313
You can find more information about self-hosting CopilotKit [here](/direct-to-llm/guides/self-hosting).
1414

1515
```tsx
16-
import { CopilotKit } from "@copilotkit/react-core/v2";
16+
import { CopilotKit } from "@copilotkit/react-core";
1717

1818
<CopilotKit runtimeUrl="<your-runtime-url>">
1919
// ... your app ...

0 commit comments

Comments
 (0)