Skip to content

Commit 220e6c0

Browse files
committed
fix
1 parent 4b6b372 commit 220e6c0

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,16 @@ Below is a minimal `wrangler.jsonc` file that defines the configuration for an A
4242
"durable_objects": {
4343
"bindings": [
4444
{
45-
"name": "MyAgent",
46-
"class_name": "MyAgent",
45+
"name": "MyAgent", // How your Agent is called from your Worker
46+
"class_name": "MyAgent", // Must match the class name of the Agent in your code
4747
},
4848
],
4949
},
5050
"migrations": [
5151
{
5252
"tag": "v1",
53-
"new_sqlite_classes": ["MyAgent"], // Mandatory
53+
// Mandatory for the Agent to store state
54+
"new_sqlite_classes": ["MyAgent"],
5455
},
5556
],
5657
"observability": {
@@ -65,4 +66,4 @@ The configuration includes:
6566

6667
- A `main` field that points to the entry point of your Agent, which is typically a TypeScript (or JavaScript) file.
6768
- A `durable_objects` field that defines the [Durable Object namespace](/durable-objects/reference/glossary/) that your Agents will run within.
68-
- A `migrations` field that defines the code migrations that your Agent will use. This field is mandatory and must contain at least one migration.
69+
- A `migrations` field that defines the code migrations that your Agent will use. This field is mandatory and must contain at least one migration. The `new_sqlite_classes` field is mandatory for the Agent to store state.

src/content/docs/agents/examples/browse-the-web.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ The [Browser Rendering](/browser-rendering/) allows you to spin up headless brow
1616
<TypeScriptExample>
1717

1818
```ts
19+
interface Env {
20+
BROWSER: Fetcher;
21+
}
1922

23+
export class MyAgent extends Agent<Env> {
2024

25+
}
2126
```
2227

2328
</TypeScriptExample>
@@ -72,4 +77,4 @@ export class MyAgent extends Agent<Env> {
7277
}
7378
```
7479

75-
</TypeScriptExample>
80+
</TypeScriptExample>

0 commit comments

Comments
 (0)