Firebase. AI. ModelContent
A type describing data in media formats interpretable by anAI model.
Summary
Each generativeAI request or response contains a list ofModelContents, and eachModelContent value may comprise multiple heterogeneousModelContent.Parts.
Constructors and Destructors | |
|---|---|
ModelContent(paramsPart[] parts) | |
ModelContent(IEnumerable<Part > parts) | |
ModelContent(string role, paramsPart[] parts)Creates a ModelContent with the given role andParts. | |
ModelContent(string role, IEnumerable<Part > parts)Creates a ModelContent with the given role andParts. |
Properties | |
|---|---|
Parts | IReadOnlyList<Part >The data parts comprising this ModelContent value. |
Role | stringThe role of the entity creating the ModelContent. |
Public static functions | |
|---|---|
FileData(string mimeType, System.Uri uri) | Creates a new ModelContent with the defaultuser role, and aFileDataPart containing the given mimeType and data. |
FunctionResponse(string name, IDictionary< string, object > response, string id) | Creates a new ModelContent with the defaultuser role, and aFunctionResponsePart containing the given name and args. |
InlineData(string mimeType, byte[] data) | Creates a new ModelContent with the defaultuser role, and anInlineDataPart containing the given mimeType and data. |
Text(string text) | |
Structs | |
|---|---|
| Firebase. | A part containing the result of executing code. |
| Firebase. | A part containing code that was executed by the model. |
| Firebase. | File data stored in CloudStorage forFirebase, referenced by a URI. |
| Firebase. | A predicted function call returned from the model. |
| Firebase. | Result output from a function call. |
| Firebase. | Data with a specified media type. |
| Firebase. | A text part containing a string value. |
Interfaces | |
|---|---|
| Firebase. | A discrete piece of data in a media format interpretable by anAI model. |
Properties
Parts
IReadOnlyList<Part>Firebase::AI::ModelContent::Parts
The data parts comprising thisModelContent value.
Role
stringFirebase::AI::ModelContent::Role
The role of the entity creating theModelContent.
For user-generated client requests, for example, the role isuser.
Public functions
ModelContent
Firebase::AI::ModelContent::ModelContent(paramsPart[]parts)
Creates aModelContent with the givenParts, using the defaultuser role.
ModelContent
Firebase::AI::ModelContent::ModelContent(IEnumerable<Part>parts)
Creates aModelContent with the givenParts, using the defaultuser role.
ModelContent
Firebase::AI::ModelContent::ModelContent(stringrole,paramsPart[]parts)
Creates aModelContent with the given role andParts.
ModelContent
Firebase::AI::ModelContent::ModelContent(stringrole,IEnumerable<Part>parts)
Creates aModelContent with the given role andParts.
Public static functions
FileData
ModelContentFirebase::AI::ModelContent::FileData(stringmimeType,System.Uriuri)
Creates a newModelContent with the defaultuser role, and aFileDataPart containing the given mimeType and data.
FunctionResponse
ModelContentFirebase::AI::ModelContent::FunctionResponse(stringname,IDictionary<string,object>response,stringid)
Creates a newModelContent with the defaultuser role, and aFunctionResponsePart containing the given name and args.
InlineData
ModelContentFirebase::AI::ModelContent::InlineData(stringmimeType,byte[]data)
Creates a newModelContent with the defaultuser role, and anInlineDataPart containing the given mimeType and data.
Text
ModelContentFirebase::AI::ModelContent::Text(stringtext)
Creates a newModelContent with the defaultuser role, and aTextPart containing the given text.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-25 UTC.