Skip to content

feat(ai): allow passing provider instance to uploadFile and uploadSkill as shorthand#14242

Merged
felixarntz merged 8 commits intomainfrom
fa/enhance-upload-file-and-skill-api
Apr 8, 2026
Merged

feat(ai): allow passing provider instance to uploadFile and uploadSkill as shorthand#14242
felixarntz merged 8 commits intomainfrom
fa/enhance-upload-file-and-skill-api

Conversation

@felixarntz
Copy link
Copy Markdown
Collaborator

@felixarntz felixarntz commented Apr 8, 2026

Background

uploadFile and uploadSkill required callers to pass the specific sub-interface (FilesV4 / SkillsV4) directly. Since ProviderV4 already exposes optional files() and skills() methods returning those interfaces, it's unnecessarily verbose to call provider.files() manually before passing it in. It still makes sense as API primitive, but we can make it easier.

Summary

Both uploadFile and uploadSkill now accept ProviderV4 as the api argument in addition to FilesV4 / SkillsV4 respectively. 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 uploadSkill that was missing from #12880.

Also renames SkillsV4's upload method to uploadSkill, 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

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Future Work

N/A

Related Issues

Follow up to #12995 and #12855

@tigent tigent bot added ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. feature New feature or request labels Apr 8, 2026
@felixarntz felixarntz added this to the v7.0 milestone Apr 8, 2026
@felixarntz felixarntz merged commit e311194 into main Apr 8, 2026
18 checks passed
@felixarntz felixarntz deleted the fa/enhance-upload-file-and-skill-api branch April 8, 2026 22:03
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Apr 8, 2026

🚀 Published in:

Package Version
ai 7.0.0-beta.74
@ai-sdk/alibaba 2.0.0-beta.22
@ai-sdk/amazon-bedrock 5.0.0-beta.26
@ai-sdk/angular 3.0.0-beta.74
@ai-sdk/anthropic 4.0.0-beta.22
@ai-sdk/assemblyai 3.0.0-beta.17
@ai-sdk/azure 4.0.0-beta.26
@ai-sdk/baseten 2.0.0-beta.20
@ai-sdk/black-forest-labs 2.0.0-beta.16
@ai-sdk/bytedance 2.0.0-beta.16
@ai-sdk/cerebras 3.0.0-beta.20
@ai-sdk/cohere 4.0.0-beta.17
@ai-sdk/deepgram 3.0.0-beta.16
@ai-sdk/deepinfra 3.0.0-beta.20
@ai-sdk/deepseek 3.0.0-beta.18
@ai-sdk/devtools 1.0.0-beta.9
@ai-sdk/elevenlabs 3.0.0-beta.16
@ai-sdk/fal 3.0.0-beta.16
@ai-sdk/fireworks 3.0.0-beta.20
@ai-sdk/gateway 4.0.0-beta.42
@ai-sdk/gladia 3.0.0-beta.16
@ai-sdk/google 4.0.0-beta.30
@ai-sdk/google-vertex 5.0.0-beta.39
@ai-sdk/groq 4.0.0-beta.19
@ai-sdk/huggingface 2.0.0-beta.20
@ai-sdk/hume 3.0.0-beta.16
@ai-sdk/klingai 4.0.0-beta.17
@ai-sdk/langchain 3.0.0-beta.74
@ai-sdk/llamaindex 3.0.0-beta.74
@ai-sdk/lmnt 3.0.0-beta.16
@ai-sdk/luma 3.0.0-beta.16
@ai-sdk/mcp 2.0.0-beta.21
@ai-sdk/mistral 4.0.0-beta.18
@ai-sdk/moonshotai 3.0.0-beta.20
@ai-sdk/open-responses 2.0.0-beta.18
@ai-sdk/openai 4.0.0-beta.26
@ai-sdk/openai-compatible 3.0.0-beta.20
@ai-sdk/otel 1.0.0-beta.20
@ai-sdk/perplexity 4.0.0-beta.19
@ai-sdk/prodia 2.0.0-beta.19
@ai-sdk/provider 4.0.0-beta.9
@ai-sdk/provider-utils 5.0.0-beta.15
@ai-sdk/react 4.0.0-beta.74
@ai-sdk/replicate 3.0.0-beta.17
@ai-sdk/revai 3.0.0-beta.17
@ai-sdk/rsc 3.0.0-beta.75
@ai-sdk/svelte 5.0.0-beta.74
@ai-sdk/togetherai 3.0.0-beta.20
@ai-sdk/valibot 3.0.0-beta.15
@ai-sdk/vercel 3.0.0-beta.20
@ai-sdk/vue 4.0.0-beta.74
@ai-sdk/xai 4.0.0-beta.31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants