本页还没有译文
本页 8 段还没译成Español,下面显示的是英文原文。uploadSkill
还没翻译译自英文(ai-sdk.dev)本页 8 段都还没译
Uploads a skill (a bundle of files) to a provider and returns a result whose providerReference (a ProviderReference) can be used in subsequent inference calls.
import { uploadSkill } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
import { readFileSync } from 'fs';
const { providerReference } = await uploadSkill({
api: anthropic.skills(),
files: [
{
path: 'my-skill/SKILL.md',
data: readFileSync('./SKILL.md'),
},
],
displayTitle: 'My Skill',
});Import
import { uploadSkill } from "ai"API Signature
Parameters
api(SkillsV4 | ProviderV4): The skills API interface to use for uploading. Can be aSkillsV4instance (e.g.anthropic.skills()) or a provider instance directly (e.g.anthropic), in which case.skills()is called automatically.files(UploadSkillFile[]): The files that make up the skill. Each file must have a relativepathanddata. Thedatacan be a string, aUint8Array, or an object withtype: 'text'and a stringtextvalue, ortype: 'data'and a stringdatavalue.displayTitle?(string): Human-readable title for the skill.providerOptions?(ProviderOptions): Additional provider-specific options.
Returns
providerReference(ProviderReference): ARecord<string, string>mapping provider names to provider-specific skill identifiers. Pass this when referencing the skill in inference calls.displayTitle?(string): Human-readable title returned by the provider (if supported).name?(string): Skill name inferred by the provider from the uploaded files.description?(string): Skill description inferred by the provider from the uploaded files.latestVersion?(string): Latest version identifier assigned by the provider.providerMetadata?(ProviderMetadata): Additional provider-specific metadata returned from the upload.warnings(Warning[]): Warnings from the provider (e.g. unsupported settings).
AI 翻译查看英文原文