Skip to content

Commit 90456ec

Browse files
committed
Add ai-sdk-v1 exmaple
1 parent 506c554 commit 90456ec

File tree

7 files changed

+985
-0
lines changed

7 files changed

+985
-0
lines changed

examples/ai-sdk-v1/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# AI SDK Example
2+
3+
This example shows how to run the Agents SDK with a model provided by the [AI SDK](https://www.npmjs.com/package/@ai-sdk/openai).
4+
5+
The [ai-sdk-model.ts](./ai-sdk-model.ts) script:
6+
7+
- Wraps the AI SDK `openai` provider with `aisdk` from `@openai/agents-extensions`.
8+
- Creates a simple `get_weather` tool that returns a mock weather string.
9+
- Defines a data agent that uses this model and tool.
10+
- Runs a parent agent that hands off to the data agent to answer a weather question.
11+
12+
## Running the script
13+
14+
From the repository root, execute:
15+
16+
```bash
17+
pnpm -F ai-sdk start:sdk-model
18+
```
19+
20+
The script prints the final output produced by the runner.

0 commit comments

Comments
 (0)