Protocols
The following protocols are available globally.
-
A protocol describing any data that could be serialized to model-interpretable input data, where the serialization process cannot fail with an error.
Declaration
Swift
public protocol PartsRepresentable -
A discrete piece of data in a media format interpretable by an AI model.
Within a single value of
Part, different data types may not mix.Declaration
Swift
public protocol Part : PartsRepresentable, Decodable, Encodable, Equatable, Sendable -
A type that represents options for controlling model response generation.
For Gemini models, this may be a
GenerationConfigvalue. For theSystemLanguageModelprovided by the Apple Foundation Models framework, this may be aGenerationOptionsor aFoundation ModelsGenerationOptionsvalue. For hybrid (on-device and cloud) configurations, usehybrid(gemini:foundationModels:)-(_,FirebaseAI.GenerationOptions)to specify options for each model.Declaration
Swift
public protocol GenerationOptionsRepresentable : Sendable -
A type that represents a large language model (LLM).
Declaration
Swift
public protocol LanguageModel : LanguageModelProvider -
A type that represents a large language model (LLM).
Declaration
Swift
public protocol LanguageModelProvider : Sendable -
A type that represents a session for interacting with a
LanguageModel.Declaration
Swift
public protocol _ModelSession : Sendable -
Undocumented
Declaration
Swift
public protocol ToolRepresentable : Sendable