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
Copy file name to clipboardExpand all lines: src/content/changelog/agents/2025-03-18-npm-i-agents.mdx
+39-21Lines changed: 39 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,39 +41,59 @@ Future updates will be pushed to the new `agents` package, and the older package
41
41
42
42
We've added a number of big new features to the Agents SDK over the past few weeks, including:
43
43
44
-
-TODO
45
-
-TODO: you can now set `cors: true` when using `routeAgentRequest` to return permissive default CORS headers to Agent responses.
46
-
-TODO: the regular client now syncs state on the agent (just like the react version)
47
-
-TODO: useAgentChat bug fixes for passing headers/credentials, properly clearing cache on unmount, etc
48
-
-TODO: experiemental /schedule module with a prompt/schema for adding scheduling to your app (with evals!)
44
+
-You can now set `cors: true` when using `routeAgentRequest` to return permissive default CORS headers to Agent responses.
45
+
-Te regular client now syncs state on the agent (just like the React version)
46
+
-`useAgentChat` bug fixes for passing headers/credentials, includng properly clearing cache on unmount.
47
+
-Experimental `/schedule` module with a prompt/schema for adding scheduling to your app (with evals!)
48
+
-Changed the internal `zod` schema to be compatible with the limitations of Google's Gemini models by removing the discriminated union, allowing you to use Gemini models with the scheduling API.
49
49
50
50
We've also fixed a number of bugs with state synchronization and the React hooks.
51
51
52
+
<TypeScriptExample>
53
+
54
+
```ts
55
+
// via https://github.com/cloudflare/agents/tree/main/examples/cross-domain
#### Call Agent methods from your client code <Badgetext="New"variant="tip"size="small" />
53
70
54
-
We've added a new [`@callable()`](/agents/api-reference/agents-api/) decorator for defining methods that can be called directly from clients. This allows you call methods from within your client code: you can call methods (with arguments) and get native JavaScript objects back.
71
+
We've added a new [`@unstable_callable()`](/agents/api-reference/agents-api/) decorator for defining methods that can be called directly from clients. This allows you call methods from within your client code: you can call methods (with arguments) and get native JavaScript objects back.
The [`agents-starter`](https://github.com/cloudflare/agents-starter) project — a real-time, chat-based example application with tool-calling & human-in-the-loop built using the Agents SDK — has seen the following updates:
92
112
93
-
- TODO
94
113
- Upgraded to use the latest [wrangler v4](/changelog/2025-03-13-wrangler-v4/) release.
95
114
- [Workers AI](/workers-ai/) is now the default AI provider in the [`agents-starter`](https://github.com/cloudflare/agents-starter) project: this uses the new [structured outputs](/changelog/2025-02-25-json-mode/) (or "JSON mode") support now in Workers AI and the [`workers-ai-provider`](https://sdk.vercel.ai/providers/community-providers/cloudflare-workers-ai#generateobject).
96
-
- Changed the internal `zod` schema to be compatible with the limitations of Google's Gemini models, allowing you to use Gemini models with the starter.
97
115
98
116
If you're new to Agents, you can install and run the `agents-starter` project in two commands:
99
117
@@ -109,7 +127,7 @@ $ npm run start
109
127
We've heard your feedback on the Agents SDK documentation, and we're shipping more API reference material and usage examples, including:
110
128
111
129
- Expanded [API reference documentation](/agents/api-reference/), covering the methods and properties exposed by the Agents SDK, as well as more usage examples.
112
-
- More [Client API](/agents/api-reference/agents-api/#client-api) documentation that documents `useAgent`, `useAgentChat` and the new `@callable` RPC decorator exposed by the SDK.
130
+
- More [Client API](/agents/api-reference/agents-api/#client-api) documentation that documents `useAgent`, `useAgentChat` and the new `@unstable_callable` RPC decorator exposed by the SDK.
113
131
- New documentation on how to [call agents](/agents/api-reference/calling-agents/) and (optionally) authenticate clients before they connect to your Agents.
114
132
115
133
Note that the Agents SDK is continually growing: the type definitions included in the SDK will always include the latest APIs exposed by the `agents` package.
0 commit comments