feat(ai): allow passing provider instance to uploadFile and uploadSkill as shorthand#14242
Merged
felixarntz merged 8 commits intomainfrom Apr 8, 2026
Merged
Conversation
gr2m
approved these changes
Apr 8, 2026
Contributor
|
🚀 Published in:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background
uploadFileanduploadSkillrequired callers to pass the specific sub-interface (FilesV4/SkillsV4) directly. SinceProviderV4already exposes optionalfiles()andskills()methods returning those interfaces, it's unnecessarily verbose to callprovider.files()manually before passing it in. It still makes sense as API primitive, but we can make it easier.Summary
Both
uploadFileanduploadSkillnow acceptProviderV4as theapiargument in addition toFilesV4/SkillsV4respectively. When a provider instance is passed, the SDK automatically resolves the appropriate sub-interface by calling.files()or.skills(). If the provider doesn't expose the required method, a clear error is thrown.Also adds a general function doc for
uploadSkillthat was missing from #12880.Also renames
SkillsV4'suploadmethod touploadSkill, for consistency and clarity - this was an oversight in the original PR.Manual Verification
You can run the new examples for verify the shorthand works.
Checklist
pnpm changesetin the project root)Future Work
N/A
Related Issues
Follow up to #12995 and #12855