You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This quick start tutorial will have you build a basic Agent that can generate code based on user questions. It will show you how the Agent SDK works, how to handle requests, store and sync state from within the Agent itself, and how to route to and call Agents from your Workers code.
This will create a new directory called `agents-quick-start`, ask you a few basic questions, and install the necessary dependencies.
25
+
26
+
Once complete, change into the Agent's directory:
27
+
28
+
```sh
29
+
cd agents-quick-start
30
+
```
31
+
32
+
19
33
### Understand the Agent class
20
34
21
35
TODO
22
36
37
+
### Run your Agent
38
+
39
+
You can run your Agent locally, which can be useful during development when iterating and/or when testing your Agent's functionality. To run your Agent locally, use the following command:
40
+
41
+
```sh
42
+
npm run dev
43
+
```
44
+
```sh output
45
+
Your Worker and resources are simulated locally via Miniflare. For more information, see: https://developers.cloudflare.com/workers/testing/local-development.
46
+
47
+
Your worker has access to the following bindings:
48
+
- Durable Objects:
49
+
- MyAgent: MyAgent
50
+
- AI:
51
+
- Name: AI [connected to remote resource]
52
+
53
+
Starting local server...
54
+
[wrangler:inf] Ready on http://localhost:8787
55
+
```
56
+
57
+
This will
58
+
59
+
60
+
### Communicate with your Agent
61
+
62
+
The example Agent in this quick start project exposes both HTTP and WebSocket endpoints
63
+
64
+
```sh
65
+
# The code in this project will automatically create a new Agent on-the-fly when
66
+
# you provide a name: e.g. /agents/my-agent/foo or /agents/my-agent/user-1238139
67
+
# This allows you to create as many Agents as you want, each with their own
0 commit comments