google.internal._gm_media_part

(internal) One prompt media part -> `inlineData` (base64) or `fileData` (a URI the API resolves itself).

Reference version

Signature

function google.internal._gm_media_part(
media: ai.MediaPart,
fetch_url: bool,
preview: bool = …
) -> google.internal.GmPart throws baml.errors.InvalidArgument | baml.errors.Io | baml.errors.Timeout | ai.errors.NetworkFailure | ai.errors.PreviewUnsupported

(internal) One prompt media part -> inlineData (base64) or fileData (a URI the API resolves itself).

fetch_url is the backend's URL strategy, mirroring sys_llm's per-provider media defaults: the Gemini Developer API has no server-side URL fetch, so an http(s) URL is downloaded and inlined (true), while Vertex takes the URL through as fileData.fileUri (false) — which also keeps large media out of the inline request-size cap. Local files always become base64 and existing base64 is retained on both backends, and a _gm_is_provider_uri URL is passed through even when fetch_url is set.

Source:<builtin>/google/ns_internal/gemini.bamlbytes 1451915531