Table of Contents

Class FunctionResponsePart

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

A datatype containing media that is part of a FunctionResponse message. A FunctionResponsePart consists of data which has an associated datatype. A FunctionResponsePart can only contain one of the accepted types in FunctionResponsePart.data. A FunctionResponsePart must have a fixed IANA MIME type identifying the type and subtype of the media if the inline_data field is filled with raw bytes.

public record FunctionResponsePart : IEquatable<FunctionResponsePart>
Inheritance
FunctionResponsePart
Implements
Inherited Members

Properties

FileData

URI based data. This field is not supported in Gemini API.

[JsonPropertyName("fileData")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public FunctionResponseFileData? FileData { get; set; }

Property Value

FunctionResponseFileData

InlineData

Inline media bytes.

[JsonPropertyName("inlineData")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public FunctionResponseBlob? InlineData { get; set; }

Property Value

FunctionResponseBlob

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a FunctionResponsePart object.

public static FunctionResponsePart? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

FunctionResponsePart

The deserialized FunctionResponsePart object, or null if deserialization fails.