Table of Contents

Class ContentPart

A datatype containing media that is part of a multi-part Content message.

A ContentPart consists of data which has an associated datatype.A ContentPart can only contain one of the accepted types in ContentPart.Data.

A ContentPart must have a fixed IANA MIME type identifying the type and subtype of the media if the InlineData field is filled with raw bytes.

public class ContentPart
Inheritance
object
ContentPart

Constructors

ContentPart()

public ContentPart()

ContentPart(FunctionResponse)

public ContentPart(FunctionResponse response)

Parameters

response FunctionResponse

Properties

FileData

URI based data.

public GoogleFileData FileData { get; set; }

Property Value

GoogleFileData

FunctionCall

A predicted FunctionCall returned from the model that contains a string representing the Name with the arguments and their values.

public FunctionCall FunctionCall { get; set; }

Property Value

FunctionCall

FunctionResponse

The result output of a FunctionCall that contains a string representing the Name and a structured JSON object containing any output from the function is used as context to the model.

public FunctionResponse FunctionResponse { get; set; }

Property Value

FunctionResponse

ImageContent

public File<Texture2D> ImageContent { get; set; }

Property Value

File<Texture2D>

InlineData

Inline media bytes.

public Blob InlineData { get; set; }

Property Value

Blob

IsImage

public bool IsImage { get; }

Property Value

bool

Text

Inline text.

public string Text { get; set; }

Property Value

string

Methods

FromBase64(string, MIMEType)

public static ContentPart FromBase64(string base64File, MIMEType mimeType)

Parameters

base64File string
mimeType MIMEType

Returns

ContentPart

FromText(string)

public static ContentPart FromText(string text)

Parameters

text string

Returns

ContentPart

FromUrl(string)

public static ContentPart FromUrl(string fileUrl)

Parameters

fileUrl string

Returns

ContentPart