Skip to content

Commit ec97cf3

Browse files
committed
agents-sdk -> agents
1 parent 32aa342 commit ec97cf3

File tree

9 files changed

+26
-26
lines changed

9 files changed

+26
-26
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ Visit the documentation on [storing and syncing state](/agents/api-reference/sto
313313
Client for connecting to an Agent from the browser.
314314

315315
```ts
316-
import { AgentClient } from "agents-sdk/client";
316+
import { AgentClient } from "agents/client";
317317

318318
// Options for creating an AgentClient
319319
type AgentClientOptions = {
@@ -341,7 +341,7 @@ class AgentClient extends WebSocket {
341341
Make an HTTP request to an Agent.
342342

343343
```ts
344-
import { agentFetch } from "agents-sdk/client";
344+
import { agentFetch } from "agents/client";
345345

346346
// Options for the agentFetch function
347347
type AgentClientFetchOptions = {
@@ -368,7 +368,7 @@ The Agents SDK provides a React API for simplifying connection and routing to Ag
368368
React hook for connecting to an Agent.
369369

370370
```ts
371-
import { useAgent } from "agents-sdk/react";
371+
import { useAgent } from "agents/react";
372372

373373
// Options for the useAgent hook
374374
type UseAgentOptions<State = unknown> = {
@@ -399,14 +399,14 @@ function useAgent<State = unknown>(
399399

400400
The Agents SDK exposes an `AIChatAgent` class that extends the `Agent` class and exposes an `onChatMessage` method that simplifies building interactive chat agents.
401401

402-
You can combine this with the `useAgentChat` React hook from the `agents-sdk/ai-react` package to manage chat state and messages between a user and your Agent(s).
402+
You can combine this with the `useAgentChat` React hook from the `agents/ai-react` package to manage chat state and messages between a user and your Agent(s).
403403

404404
#### AIChatAgent
405405

406406
Extension of the `Agent` class with built-in chat capabilities.
407407

408408
```ts
409-
import { AIChatAgent } from "agents-sdk/ai-chat-agent";
409+
import { AIChatAgent } from "agents/ai-chat-agent";
410410
import { Message, StreamTextOnFinishCallback } from "ai";
411411

412412
// Base class for chat-specific agents
@@ -432,8 +432,8 @@ class AIChatAgent<Env = unknown> extends Agent<Env> {
432432
React hook for building AI chat interfaces using an Agent.
433433

434434
```ts
435-
import { useAgentChat } from "agents-sdk/ai-react";
436-
import { useAgent } from "agents-sdk/react";
435+
import { useAgentChat } from "agents/ai-react";
436+
import { useAgent } from "agents/react";
437437
import type { Message } from "ai";
438438

439439
// Options for the useAgentChat hook

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ See the usage patterns in the following example:
2626
<TypeScriptExample>
2727

2828
```ts
29-
import { Agent, AgentNamespace, getAgentByName, routeAgentRequest } from 'agents-sdk';
29+
import { Agent, AgentNamespace, getAgentByName, routeAgentRequest } from 'agents';
3030

3131
interface Env {
3232
// Define your Agent on the environment here
@@ -39,7 +39,7 @@ export default {
3939
async fetch(request, env, ctx): Promise<Response> {
4040
// Routed addressing
4141
// Automatically routes HTTP requests and/or WebSocket connections to /agents/:agent/:name
42-
// Best for: connecting React apps directly to Agents using useAgent from agents-sdk/react
42+
// Best for: connecting React apps directly to Agents using useAgent from agents/react
4343
return (await routeAgentRequest(request, env)) || Response.json({ msg: 'no agent here' }, { status: 404 });
4444

4545
// Named addressing
@@ -80,7 +80,7 @@ The example below shows how to create a unique agent Agent for each `userId` in
8080
<TypeScriptExample>
8181

8282
```ts
83-
import { Agent, AgentNamespace, getAgentByName, routeAgentRequest } from 'agents-sdk';
83+
import { Agent, AgentNamespace, getAgentByName, routeAgentRequest } from 'agents';
8484

8585
interface Env {
8686
MyAgent: AgentNamespace<MyAgent>;
@@ -121,7 +121,7 @@ The `routeAgentRequest` helper documented earlier in this guide exposes two usef
121121
<TypeScriptExample>
122122

123123
```ts
124-
import { Agent, AgentNamespace, routeAgentRequest } from 'agents-sdk';
124+
import { Agent, AgentNamespace, routeAgentRequest } from 'agents';
125125

126126
interface Env {
127127
MyAgent: AgentNamespace<MyAgent>;
@@ -163,7 +163,7 @@ For example, if you are using [Hono](https://hono.dev/), you can authenticate in
163163
<TypeScriptExample>
164164

165165
```ts
166-
import { Agent, AgentNamespace, getAgentByName } from 'agents-sdk';
166+
import { Agent, AgentNamespace, getAgentByName } from 'agents';
167167
import { Hono } from 'hono';
168168

169169
const app = new Hono<{ Bindings: Env }>();

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ TODO
2424
<TypeScriptExample>
2525

2626
```ts
27-
import { useAgent } from "agents-sdk/react";
27+
import { useAgent } from "agents/react";
2828

2929
// TODO
3030
```
@@ -38,8 +38,8 @@ TODO
3838
<TypeScriptExample>
3939

4040
```ts
41-
import { useAgent } from "agents-sdk/react";
42-
import { useAgentChat } from "agents-sdk/ai-react";
41+
import { useAgent } from "agents/react";
42+
import { useAgentChat } from "agents/ai-react";
4343

4444
// TODO
4545
```
@@ -60,7 +60,7 @@ TODO
6060

6161
```ts
6262
import { useState } from "react";
63-
import { useAgent } from "agents-sdk/react";
63+
import { useAgent } from "agents/react";
6464

6565
// TODO
6666
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The following example uses the AI SDK to generate text and stream it back to the
4747
<TypeScriptExample>
4848

4949
```ts
50-
import { Agent, AgentNamespace, getAgentByName, routeAgentRequest } from 'agents-sdk';
50+
import { Agent, AgentNamespace, getAgentByName, routeAgentRequest } from 'agents';
5151
import { streamText } from 'ai';
5252
import { createOpenAI, openai } from '@ai-sdk/openai';
5353

src/content/docs/agents/api-reference/store-and-sync-state.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ Any initial state is synced to clients connecting via [the `useAgent` hook](#syn
125125

126126
### Synchronizing state
127127

128-
Clients can connect to an Agent and stay synchronized with its state using the React hooks provided as part of `agents-sdk/react`.
128+
Clients can connect to an Agent and stay synchronized with its state using the React hooks provided as part of `agents/react`.
129129

130130
A React application can call `useAgent` to connect to a named Agent over WebSockets at
131131

132132
<TypeScriptExample>
133133

134134
```ts
135135
import { useState } from "react";
136-
import { useAgent } from "agents-sdk/react";
136+
import { useAgent } from "agents/react";
137137

138138
function StateInterface() {
139139
const [state, setState] = useState({ counter: 0 });

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ export class ChatAgent extends Agent {
4040

4141
### Connecting clients
4242

43-
The Agent framework includes a useful helper package for connecting directly to your Agent (or other Agents) from a client application. Import `agents-sdk/client`, create an instance of `AgentClient` and use it to connect to an instance of your Agent:
43+
The Agent framework includes a useful helper package for connecting directly to your Agent (or other Agents) from a client application. Import `agents/client`, create an instance of `AgentClient` and use it to connect to an instance of your Agent:
4444

4545
<TypeScriptExample>
4646

4747
```ts
48-
import { AgentClient } from "agents-sdk/client";
48+
import { AgentClient } from "agents/client";
4949

5050
const connection = new AgentClient({
5151
agent: "dialogue-agent",
@@ -68,12 +68,12 @@ connection.send(
6868

6969
### React clients
7070

71-
React-based applications can import `agents-sdk/react` and use the `useAgent` hook to connect to an instance of an Agent directly:
71+
React-based applications can import `agents/react` and use the `useAgent` hook to connect to an instance of an Agent directly:
7272

7373
<TypeScriptExample>
7474

7575
```ts
76-
import { useAgent } from "agents-sdk/react";
76+
import { useAgent } from "agents/react";
7777

7878
function AgentInterface() {
7979
const connection = useAgent({

src/content/docs/agents/getting-started/build-a-chat-agent.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ external_link: https://github.com/cloudflare/agents-starter
55
sidebar:
66
order: 3
77
head: []
8-
description: A starter template for building AI-powered chat agents using Cloudflare's Agent platform, powered by agents-sdk. This project provides a foundation for creating interactive chat experiences with AI, complete with a modern UI and tool integration capabilities.
8+
description: A starter template for building AI-powered chat agents using Cloudflare's Agent platform, powered by the Agents SDK. This project provides a foundation for creating interactive chat experiences with AI, complete with a modern UI and tool integration capabilities.
99
---

src/content/docs/agents/getting-started/prompting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ external_link: /workers/get-started/prompting/
55
sidebar:
66
order: 10
77
head: []
8-
description: Use the Workers "mega prompt" to build a Agents using your preferred AI tools and/or IDEs. The prompt understands agents-sdk APIs, best practices and guidelines, and makes it easier to build valid Agents and Workers.
8+
description: Use the Workers "mega prompt" to build a Agents using your preferred AI tools and/or IDEs. The prompt understands the Agents SDK APIs, best practices and guidelines, and makes it easier to build valid Agents and Workers.
99
---

src/content/docs/agents/getting-started/testing-your-agent.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Because Agents run on Cloudflare Workers and Durable Objects, they can be tested
1616

1717
:::note
1818

19-
The `agents-sdk-starter` template and new Cloudflare Workers projects already include the relevant `vitest` and `@cloudflare/vitest-pool-workers` packages, as well as a valid `vitest.config.js` file.
19+
The `agents-starter` template and new Cloudflare Workers projects already include the relevant `vitest` and `@cloudflare/vitest-pool-workers` packages, as well as a valid `vitest.config.js` file.
2020

2121
:::
2222

0 commit comments

Comments
 (0)