Skip to content

Commit adf64aa

Browse files
committed
use gpt-oss for the example
1 parent 90456ec commit adf64aa

File tree

3 files changed

+74
-5
lines changed

3 files changed

+74
-5
lines changed

examples/ai-sdk/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export async function runAgents(model: AiSdkModel) {
3030
instructions:
3131
'You are a helpful assistant. When you need to get the weather, you can hand off the task to the Weather Data Agent.',
3232
handoffs: [dataAgent],
33+
model, // Using the AI SDK model for this agent
3334
});
3435

3536
const result = await run(
@@ -39,12 +40,17 @@ export async function runAgents(model: AiSdkModel) {
3940
console.log(result.finalOutput);
4041
}
4142

42-
import { openai } from '@ai-sdk/openai';
43+
import { createOpenRouter } from '@openrouter/ai-sdk-provider';
44+
// import { openai } from '@ai-sdk/openai';
4345
// import { anthropic } from '@ai-sdk/anthropic';
4446
// import { google } from '@ai-sdk/google';
4547

4648
(async function () {
47-
const model = aisdk(openai('gpt-4.1-nano'));
49+
const openRouter = createOpenRouter({
50+
apiKey: process.env.OPENROUTER_API_KEY,
51+
});
52+
const model = aisdk(openRouter('openai/gpt-oss-120b'));
53+
// const model = aisdk(openai('gpt-4.1-nano'));
4854
// const model = aisdk(anthropic('claude-sonnet-4-20250514'));
4955
// const model = aisdk(google('gemini-2.5-flash'));
5056
await runAgents(model);

examples/ai-sdk/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"@ai-sdk/openai": "^2.0.15",
66
"@openai/agents": "workspace:*",
77
"@openai/agents-extensions": "workspace:*",
8+
"@openrouter/ai-sdk-provider": "^1.1.2",
89
"zod": "3.25.62"
910
},
1011
"scripts": {

pnpm-lock.yaml

Lines changed: 65 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)