Firebase.AI.ModelContent

A type describing data in media formats interpretable by an AI model.

Summary

Each generative AI request or response contains a list of ModelContents, and each ModelContent value may comprise multiple heterogeneous ModelContent.Parts.

Constructors and Destructors

ModelContent(params Part[] parts)
Creates a ModelContent with the given Parts, using the default user role.
ModelContent(IEnumerable< Part > parts)
Creates a ModelContent with the given Parts, using the default user role.
ModelContent(string role, params Part[] parts)
Creates a ModelContent with the given role and Parts.
ModelContent(string role, IEnumerable< Part > parts)
Creates a ModelContent with the given role and Parts.

Properties

Parts
IEnumerable< Part >
The data parts comprising this ModelContent value.
Role
string
The role of the entity creating the ModelContent.

Public static functions

FileData(string mimeType, System.Uri uri)
Creates a new ModelContent with the default user role, and a FileDataPart containing the given mimeType and data.
FunctionResponse(string name, IDictionary< string, object > response)
Creates a new ModelContent with the default user role, and a FunctionResponsePart containing the given name and args.
InlineData(string mimeType, byte[] data)
Creates a new ModelContent with the default user role, and an InlineDataPart containing the given mimeType and data.
Text(string text)
Creates a new ModelContent with the default user role, and a TextPart containing the given text.

Structs

Firebase.AI.ModelContent.FileDataPart

File data stored in Cloud Storage for Firebase, referenced by a URI.

Firebase.AI.ModelContent.FunctionCallPart

A predicted function call returned from the model.

Firebase.AI.ModelContent.FunctionResponsePart

Result output from a function call.

Firebase.AI.ModelContent.InlineDataPart

Data with a specified media type.

Firebase.AI.ModelContent.TextPart

A text part containing a string value.

Interfaces

Firebase.AI.ModelContent.Part

A discrete piece of data in a media format interpretable by an AI model.

Properties

Parts

IEnumerable< Part > Firebase::AI::ModelContent::Parts

The data parts comprising this ModelContent value.

Role

string Firebase::AI::ModelContent::Role

The role of the entity creating the ModelContent.

For user-generated client requests, for example, the role is user.

Public functions

ModelContent

 Firebase::AI::ModelContent::ModelContent(
  params Part[] parts
)

Creates a ModelContent with the given Parts, using the default user role.

ModelContent

 Firebase::AI::ModelContent::ModelContent(
  IEnumerable< Part > parts
)

Creates a ModelContent with the given Parts, using the default user role.

ModelContent

 Firebase::AI::ModelContent::ModelContent(
  string role,
  params Part[] parts
)

Creates a ModelContent with the given role and Parts.

ModelContent

 Firebase::AI::ModelContent::ModelContent(
  string role,
  IEnumerable< Part > parts
)

Creates a ModelContent with the given role and Parts.

Public static functions

FileData

ModelContent Firebase::AI::ModelContent::FileData(
  string mimeType,
  System.Uri uri
)

Creates a new ModelContent with the default user role, and a FileDataPart containing the given mimeType and data.

FunctionResponse

ModelContent Firebase::AI::ModelContent::FunctionResponse(
  string name,
  IDictionary< string, object > response
)

Creates a new ModelContent with the default user role, and a FunctionResponsePart containing the given name and args.

InlineData

ModelContent Firebase::AI::ModelContent::InlineData(
  string mimeType,
  byte[] data
)

Creates a new ModelContent with the default user role, and an InlineDataPart containing the given mimeType and data.

Text

ModelContent Firebase::AI::ModelContent::Text(
  string text
)

Creates a new ModelContent with the default user role, and a TextPart containing the given text.