Table of Contents

Class RemoteFileContent

Namespace
GenerativeAI.Microsoft.Extensions
Assembly
GenerativeAI.Microsoft.dll

Marker AIContent that points at a previously-uploaded Files-API asset. Produced by PromoteOversizedAttachmentsAsync(IList<ChatMessage>, GenerativeModel, CancellationToken) when a Microsoft.Extensions.AI.DataContent exceeds Gemini's 20 MB inline_data limit; ToPart(AIContent, ChatOptions?) then emits a FileData part referencing the remote URI instead of an inline blob.

public sealed class RemoteFileContent : AIContent
Inheritance
AIContent
RemoteFileContent
Inherited Members
AIContent.Annotations
AIContent.RawRepresentation
AIContent.AdditionalProperties
Extension Methods

Constructors

RemoteFileContent(RemoteFile, string?)

Initializes a new instance of the RemoteFileContent class.

public RemoteFileContent(RemoteFile remoteFile, string? mimeType = null)

Parameters

remoteFile RemoteFile

The uploaded file to reference.

mimeType string

Optional MIME type override; defaults to the file's own MIME type.

Properties

MimeType

Gets the MIME type override, or null to use RemoteFile's MIME type.

public string? MimeType { get; }

Property Value

string

RemoteFile

Gets the uploaded file this content refers to.

public RemoteFile RemoteFile { get; }

Property Value

RemoteFile