Anthropic::FileUpload
Represents a file to be uploaded to the Skills API
file = Anthropic::FileUpload.new(
io: File.open("tool.py"),
filename: "tool.py",
content_type: "text/x-python"
)
skill = client.beta.skills.create(
files: [file],
display_title: "My Skill"
)
Constructors
Create from a file path with auto-detected content type
Content type is inferred from the file extension. You can override it explicitly, or provide a custom filename for the upload.
# Auto-detect content type from extension
file = Anthropic::FileUpload.from_path("src/tool.py")
# Override filename (e.g. for skill directory structure)
file = Anthropic::FileUpload.from_path(
"src/tool.py",
filename: "skill-name/tool.py"
)
# Override content type explicitly
file = Anthropic::FileUpload.from_path(
"data/config",
content_type: "application/json"
)
Class methods
Instance methods
content_type
Sourcefilename
Sourceio
Source