File

@SerialName(value = "file")
class File(val mediaType: String, val base64: String = "", val filename: String? = null, val providerMetadata: ProviderMetadata = ProviderMetadata.None, val url: String? = null) : ContentPart(source)

File content — payload data the model produced or that's attached to a turn. Per historical parity gap #38, mirrors v6's richer FilePart.data. Currently base64 is the only data shape; a URL-shaped variant lives in Source. filename is the user-facing label (Anthropic models produce it for artifact-like outputs; v6 has a dedicated slot for it).

Since

0.3.0-beta01

Constructors

Link copied to clipboard
constructor(mediaType: String, base64: String = "", filename: String? = null, providerMetadata: ProviderMetadata = ProviderMetadata.None, url: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard

Optional display name. v6 calls this filename.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val url: String?

Remote (or data) URL for the file content, when not provided inline as base64. Mirrors v6's data: DataContent | URL. Resolve with convertToLanguageModelPrompt for providers that don't accept URLs.