Skip to content

Commit 0c60cb4

Browse files
docs: update import paths for @cloudflare/ai-chat package split
Update documentation to reflect the package reorganization where AI chat functionality has been extracted into @cloudflare/ai-chat package: - Update import paths from agents/ai-chat-agent to @cloudflare/ai-chat - Update import paths from agents/ai-react to @cloudflare/ai-chat/react - Affects human-in-the-loop guide and agents API reference Related to cloudflare/agents#756 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent e1169a3 commit 0c60cb4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/content/docs/agents/api-reference/agents-api.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ You can combine this with the `useAgentChat` React hook from the `agents/ai-reac
811811
Extension of the `Agent` class with built-in chat capabilities.
812812

813813
```ts
814-
import { AIChatAgent } from "agents/ai-chat-agent";
814+
import { AIChatAgent } from "@cloudflare/ai-chat";
815815
import { Message, StreamTextOnFinishCallback, ToolSet } from "ai";
816816

817817
// Base class for chat-specific agents
@@ -834,7 +834,7 @@ class AIChatAgent<Env = unknown, State = unknown> extends Agent<Env, State> {
834834

835835
```ts
836836
// Example of extending AIChatAgent
837-
import { AIChatAgent } from "agents/ai-chat-agent";
837+
import { AIChatAgent } from "@cloudflare/ai-chat";
838838
import { Message } from "ai";
839839

840840
interface Env {
@@ -897,7 +897,7 @@ When you use `AIChatAgent` with `useAgentChat`:
897897
<TypeScriptExample>
898898

899899
```ts
900-
import { AIChatAgent } from "agents/ai-chat-agent";
900+
import { AIChatAgent } from "@cloudflare/ai-chat";
901901
import { streamText } from "ai";
902902
import { openai } from "@ai-sdk/openai";
903903

@@ -938,7 +938,7 @@ const { messages } = useAgentChat({
938938
React hook for building AI chat interfaces using an Agent.
939939

940940
```ts
941-
import { useAgentChat } from "agents/ai-react";
941+
import { useAgentChat } from "@cloudflare/ai-chat/react";
942942
import { useAgent } from "agents/react";
943943
import type { Message } from "ai";
944944

@@ -1012,7 +1012,7 @@ function useAgentChat(options: UseAgentChatOptions): {
10121012

10131013
```tsx
10141014
// Example of using useAgentChat in a React component
1015-
import { useAgentChat } from "agents/ai-react";
1015+
import { useAgentChat } from "@cloudflare/ai-chat/react";
10161016
import { useAgent } from "agents/react";
10171017
import { useState } from "react";
10181018

src/content/docs/agents/guides/human-in-the-loop.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Create your tool definitions at `src/tools.ts`. Tools can be configured to eithe
9696
```ts
9797
import { tool } from "ai";
9898
import { z } from "zod";
99-
import type { AITool } from "agents/ai-react";
99+
import type { AITool } from "@cloudflare/ai-chat/react";
100100

101101
// Server-side tool that requires confirmation (no execute function)
102102
const getWeatherInformationTool = tool({
@@ -224,7 +224,7 @@ Create your agent implementation at `src/server.ts`:
224224
```ts
225225
import { openai } from "@ai-sdk/openai";
226226
import { routeAgentRequest } from "agents";
227-
import { AIChatAgent } from "agents/ai-chat-agent";
227+
import { AIChatAgent } from "@cloudflare/ai-chat";
228228
import {
229229
convertToModelMessages,
230230
createUIMessageStream,
@@ -311,7 +311,7 @@ import type { UIMessage as Message } from "ai";
311311
import { getToolName, isToolUIPart } from "ai";
312312
import { clientTools } from "./tools";
313313
import { APPROVAL, toolsRequiringConfirmation } from "./utils";
314-
import { useAgentChat, type AITool } from "agents/ai-react";
314+
import { useAgentChat, type AITool } from "@cloudflare/ai-chat/react";
315315
import { useAgent } from "agents/react";
316316
import { useCallback, useEffect, useRef, useState } from "react";
317317

0 commit comments

Comments
 (0)