Skip to content

Commit b5ee385

Browse files
committed
update
1 parent 85c5eb8 commit b5ee385

File tree

2 files changed

+18
-83
lines changed

2 files changed

+18
-83
lines changed

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import { MetaInfo, Render, Type, TypeScriptExample, WranglerConfig } from "~/com
99

1010
This page provides an overview of the Agent SDK API, including the `Agent` class, methods and properties built-in to the Agents SDK.
1111

12-
An Agent is a JavaScript class that extends the `Agent` class from the Agents SDK package. An Agent encapsulates all of the logic for an Agent, including how clients can connect to it, how it stores state, the methods it exposes, and any error handling.
12+
The Agents SDK exposes two main APIs:
13+
14+
* The server-side `Agent` class. An Agent encapsulates all of the logic for an Agent, including how clients can connect to it, how it stores state, the methods it exposes, how to call AI models, and any error handling.
15+
* The client-side `AgentClient` class, which allows you to connect to an Agent instance from a client-side application. The client APIs also include React hooks, including `useAgent` and `useAgentChat`, and allow you to automatically synchronize state between each unique Agent (running server-side) and your client applications.
16+
17+
You can also find more specific usage examples for each API in the [Agents API Reference](/agents/api-reference/).
1318

1419
<TypeScriptExample>
1520

@@ -570,10 +575,21 @@ async searchUsers(term: string): Promise<User[]> {
570575
571576
</TypeScriptExample>
572577
573-
Visit the documentation on [storing and syncing state](/agents/api-reference/store-and-sync-state/) to learn more about the `this.setState` and `this.sql` APIs.
578+
:::note
579+
580+
Visit the [state management API documentation](/agents/api-reference/store-and-sync-state/) within the Agents SDK, including the native `state` APIs and the built-in `this.sql` API for storing and querying data within your Agents.
581+
582+
:::
583+
574584
575585
### Client API
576586
587+
The Agents SDK provides a set of client APIs for interacting with Agents from client-side JavaScript code, including:
588+
589+
* React hooks, including `useAgent` and `useAgentChat`, for connecting to Agents from client applications.
590+
* Client-side [state syncing](/agents/api-reference/store-and-sync-state/) that allows you to subscribe to state updates between the Agent and any connected client(s) when calling `this.setState` within your Agent's code.
591+
* The ability to call remote methods (Remote Procedure Calls; RPC) on the Agent from client-side JavaScript code using the `@callable` method decorator.
592+
577593
#### AgentClient
578594
579595
Client for connecting to an Agent from the browser.

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

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)