FirebaseAI Framework Reference

ModelContent

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
public struct ModelContent : Equatable, Sendable
extension ModelContent: Codable

A type describing data in media formats interpretable by an AI model. Each generative AI request or response contains an Array of ModelContents, and each ModelContent value may comprise multiple heterogeneous Parts.

  • The role of the entity creating the ModelContent. For user-generated client requests, for example, the role is user.

    Declaration

    Swift

    public let role: String?
  • The data parts comprising this ModelContent value.

    Declaration

    Swift

    public var parts: [any Part] { get }
  • Creates a new value from a list of Parts.

    Declaration

    Swift

    public init(role: String? = "user", parts: [any Part])
  • Creates a new value from any data interpretable as a Part. See PartsRepresentable for types that can be interpreted as Parts.

    Declaration

    Swift

    public init(role: String? = "user", parts: any PartsRepresentable...)
  • Declaration

    Swift

    public init(from decoder: any Decoder) throws
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy