-
Notifications
You must be signed in to change notification settings - Fork 514
[Proposal]: New tool calling DX #1770
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
import { openai } from "@ai-sdk/openai"; | ||
import { streamText } from "ai"; | ||
// import { aiSDKAdapter } from "@assistant-ui/rea=-ct"; |
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.
There's a typo in the import comment for @assistant-ui/react
where an equals sign is incorrectly included in the package name.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
// import { aiSDKAdapter } from "@assistant-ui/rea=-ct"; | |
// import { aiSDKAdapter } from "@assistant-ui/react"; |
examples/with-ai-sdk/tools.ts
Outdated
// }, | ||
// }); | ||
|
||
export const weatherTool = aiSDKAdapter(webSearchTool); |
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.
The aiSDKAdapter
is applied to webSearchTool
but should be applied to the corrected weatherTool
implementation.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
export const weatherTool = aiSDKAdapter(webSearchTool); | |
export const weatherToolAdapter = aiSDKAdapter(weatherTool); |
Pull request summary
|
Pull request summary
|
This PR is a proposal of a more typesafe way to define tools. I've made minimal adjustments to the existing set of types across the application but just re worked the tool schema definition.
The goal of this is to push the user to define their tools in a central set of places so that they can prevent duplicate tools, and take advantage of the type-safety that centralization provides. We split the tools into client and server tools, but the tools would eventually be registered in one "tool box" across the set of tools.
If this approach looks good I'll also add typesafe client side tool handling, it's a pita to do with existing tools and I'd love to fix it.