Class InteractionMediaContent
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
Base class for media content blocks (image, audio, video, document), which carry either inline base64 Data or a Uri.
public abstract class InteractionMediaContent : InteractionContent
- Inheritance
-
InteractionMediaContent
- Derived
- Inherited Members
- Extension Methods
Constructors
InteractionMediaContent(string)
Initializes a new media content block with the given discriminator.
protected InteractionMediaContent(string type)
Parameters
typestringThe
typediscriminator.
Properties
Data
The base64-encoded media bytes (inline delivery).
[JsonPropertyName("data")]
public string? Data { get; set; }
Property Value
MimeType
The MIME type of the media.
[JsonPropertyName("mime_type")]
public string? MimeType { get; set; }
Property Value
Uri
The URI of the media (URI delivery, uploaded files, Cloud Storage, etc.).
[JsonPropertyName("uri")]
public string? Uri { get; set; }
Property Value
Methods
GetDataBytes()
public byte[]? GetDataBytes()
Returns
- byte[]
The media bytes, or
null.