-
Notifications
You must be signed in to change notification settings - Fork 246
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
refactor: add ToolRegistry #372
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
eae6747
to
32480a7
Compare
import { LanguageModelV1FinishReason } from "@ai-sdk/provider"; | ||
import { | ||
CoreMessage, | ||
CoreTool, |
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.
Deprecated in Vercel AI SDK.
AnthropicModelFamily, | ||
Record<AnthropicToolType, AnthropicToolVersion> | ||
> = { | ||
"claude-3-5": { |
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.
Easy to extend with 3.7.
tools["bash"] = bashToolEntry.factory(); | ||
} catch (error) { | ||
if (!(error instanceof ShortestError)) throw error; | ||
this.log.trace("Bash tool not found for model, skipping", { model }); |
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.
If a tool is not found (e.g. bash for 3.7 not yet available upstream), the package will still work without the tool.
}); | ||
}); | ||
|
||
it("registers tools with expected keys", () => { |
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.
This ensures all the tools available are properly registered. If a tool doesn't get registered, and not passed to the AI, the AI will do its best to complete the task with the missing tool. It will not be obvious - through a script error - that a tool is missing).
What
Implement a comprehensive refactoring of the AI tools system
Why
In preparation for adding Claude 3.7.
Ref #369 (comment)