-
Notifications
You must be signed in to change notification settings - Fork 498
Fix #283 #291 #300 migrate ai-sdk/provider to v2 #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@openai/agents-extensions': minor | ||
| --- | ||
|
|
||
| Fix #283 #291 #300 migrate ai-sdk/provider to v2 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # AI SDK Example | ||
|
|
||
| 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). | ||
|
|
||
| The [ai-sdk-model.ts](./ai-sdk-model.ts) script: | ||
|
|
||
| - Wraps the AI SDK `openai` provider with `aisdk` from `@openai/agents-extensions`. | ||
| - Creates a simple `get_weather` tool that returns a mock weather string. | ||
| - Defines a data agent that uses this model and tool. | ||
| - Runs a parent agent that hands off to the data agent to answer a weather question. | ||
|
|
||
| ## Running the script | ||
|
|
||
| From the repository root, execute: | ||
|
|
||
| ```bash | ||
| pnpm -F ai-sdk start:sdk-model | ||
| ``` | ||
|
|
||
| The script prints the final output produced by the runner. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkundel-openai Since this could be a breaking change to existing users, I think it's worth bumping the minor version. As for the compatibility with Python SDK, it's already v0.2 for different reasons (e.g., adding realtime agents). So, this project can decide when to upgrade the version now. Do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is AI SDK v2 stable for us to go and fully cut over or is there any value to maintain both for now? Like should we copy the code and expose
aisdk.v1(...)andaisdk.v2(...). Not opposed to a minor bump more concerned if one breaks the other.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkundel-openai a challenge here is that you cannot have both v1 and v2 as peer dependencies for the same package. If we want to support both, we need to have two separate sub packages like
@openai/agents-ai-sdk-v1and@openai/agents-ai-sdk-v2.