Skip to content

Commit 01b919d

Browse files
committed
remove unstable\_ prefixes with deprecation warnings
1 parent 2684ade commit 01b919d

File tree

15 files changed

+102
-38
lines changed

15 files changed

+102
-38
lines changed

.changeset/olive-cities-tell.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"agents": patch
3+
---
4+
5+
remove unstable\_ prefixes with deprecation warnings
6+
7+
This deprecates all unstable\_ prefixes with deprecation warnings. Specifically:
8+
9+
- unstable_callable -> callable
10+
- unstable_getAITools -> getAITools
11+
- unstable_getSchedulePrompt -> getSchedulePrompt
12+
- unstable_scheduleSchema -> scheduleSchema
13+
14+
Using the unstable\_ prefixed versions will now emit a deprecation warning. In the next major version, the unstable\_ prefixed versions will be removed.

examples/mcp-elicitation-demo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
Agent,
1616
type AgentNamespace,
1717
routeAgentRequest,
18-
unstable_callable as callable,
18+
callable,
1919
type Connection,
2020
type WSMessage
2121
} from "agents";

examples/mcp-elicitation-demo/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
Agent,
55
type AgentNamespace,
66
routeAgentRequest,
7-
unstable_callable as callable,
7+
callable,
88
type Connection,
99
type WSMessage
1010
} from "agents";

examples/playground/src/agents/rpc.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
Agent,
3-
type StreamingResponse,
4-
unstable_callable as callable
5-
} from "agents";
1+
import { Agent, type StreamingResponse, callable } from "agents";
62
import type { Env } from "../server";
73

84
export class Rpc extends Agent<Env> {

examples/playground/src/agents/scheduler.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import type { Connection, ConnectionContext, Schedule } from "agents";
22
import { Agent } from "agents";
3-
import {
4-
unstable_getSchedulePrompt,
5-
unstable_scheduleSchema
6-
} from "agents/schedule";
3+
import { getSchedulePrompt, scheduleSchema } from "agents/schedule";
74
import { generateObject } from "ai";
85
import { model } from "../model";
96
import type { Env } from "../server";
@@ -42,11 +39,11 @@ export class Scheduler extends Agent<Env> {
4239
maxRetries: 5,
4340
mode: "json",
4441
model,
45-
prompt: `${unstable_getSchedulePrompt({
42+
prompt: `${getSchedulePrompt({
4643
date: new Date()
4744
})}
4845
Input to parse: "${event.input}"`,
49-
schema: unstable_scheduleSchema, // <- the shape of the object that the scheduler expects
46+
schema: scheduleSchema, // <- the shape of the object that the scheduler expects
5047
schemaDescription: "A task to be scheduled",
5148
schemaName: "task"
5249
});

examples/tictactoe/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { openai } from "@ai-sdk/openai";
22
import {
33
Agent,
44
type AgentNamespace,
5-
unstable_callable as callable,
5+
callable,
66
routeAgentRequest
77
} from "agents";
88

openai-sdk/human-in-the-loop/src/server.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { Agent, type RunResult, RunState, run, tool } from "@openai/agents";
2-
import {
3-
Agent as CFAgent,
4-
unstable_callable as callable,
5-
routeAgentRequest
6-
} from "agents";
2+
import { Agent as CFAgent, callable, routeAgentRequest } from "agents";
73
import { z } from "zod";
84

95
type Env = {

openai-sdk/llm-as-a-judge/src/server.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { Agent, type AgentInputItem, run, withTrace } from "@openai/agents";
2-
import {
3-
Agent as CFAgent,
4-
unstable_callable as callable,
5-
routeAgentRequest
6-
} from "agents";
2+
import { Agent as CFAgent, callable, routeAgentRequest } from "agents";
73
import { z } from "zod";
84

95
type Env = {

packages/agents/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ import { generateText } from "ai";
488488
// Convert MCP tools for AI use
489489
const result = await generateText({
490490
model: openai("gpt-4"),
491-
tools: client.unstable_getAITools(),
491+
tools: client.getAITools(),
492492
prompt: "What's the weather in Tokyo?"
493493
});
494494
```

packages/agents/evals/scheduling.eval.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { generateObject } from "ai";
55
import { createScorer, evalite } from "evalite";
66
import {
77
type Schedule,
8-
unstable_getSchedulePrompt,
9-
unstable_scheduleSchema
8+
getSchedulePrompt,
9+
scheduleSchema
1010
} from "../src/schedule";
1111

1212
const model = openai("gpt-4o");
@@ -330,13 +330,13 @@ evalite<string, Schedule>("Evals for scheduling", {
330330
const result = await generateObject({
331331
maxRetries: 5,
332332
model, // <- the shape of the object that the scheduler expects
333-
prompt: `${unstable_getSchedulePrompt({ date: new Date() })}
333+
prompt: `${getSchedulePrompt({ date: new Date() })}
334334
335335
Input to parse: "${input}"`,
336336
// mode: "json",
337337
// schemaName: "task",
338338
// schemaDescription: "A task to be scheduled",
339-
schema: unstable_scheduleSchema
339+
schema: scheduleSchema
340340
});
341341
return result.object;
342342
} catch (error) {

0 commit comments

Comments
 (0)