- [added] Emits a warning when attempting to use an incompatible model with
GenerativeModel
orImagenModel
. (#14610)
- [feature] The Vertex AI SDK no longer requires
@preconcurrency
when imported in Swift 6. - [feature] The Vertex AI Sample App now includes an image generation example.
- [changed] The Vertex AI Sample App is now part of the quickstart-ios repo.
- [changed] The
role
in system instructions is now ignored; no code changes are required. (#14558)
- [feature] Public Preview: Added support for generating images using the
Imagen 3 model.
Note: This feature is in Public Preview, which means that the it is not subject to any SLA or deprecation policy and could change in backwards-incompatible ways. - [feature] Added support for modality-based token count. (#14406)
- [changed] The token counts from
GenerativeModel.countTokens(...)
now include tokens from the schema for JSON output and function calling; reported token counts will now be higher if using these features.
- [fixed] Fixed an issue where
VertexAI.vertexAI(app: app1)
andVertexAI.vertexAI(app: app2)
would return the same instance if theirlocation
was the same, including the defaultus-central1
. (#14007) - [changed] Removed
format: "double"
inSchema.double()
since double-precision accuracy isn't enforced by the model; continue using the SwiftDouble
type when decoding data produced with this schema. (#13990)
- [feature] Vertex AI in Firebase is now Generally Available (GA) and can be
used in production apps. (#13725)
Use the Vertex AI in Firebase library to call the Vertex AI Gemini API directly from your app. This client library is built specifically for use with Swift apps, offering security options against unauthorized clients as well as integrations with other Firebase services.
Note: Vertex AI in Firebase is currently only available in Swift Package Manager and CocoaPods. Stay tuned for the next release for the Zip and Carthage distributions.
- If you're new to this library, visit the getting started guide.
- If you used the preview version of the library, visit the migration guide to learn about some important updates.
- [changed] Breaking Change: The
HarmCategory
enum is no longer nested inside theSafetySetting
struct and theunspecified
case has been removed. (#13686) - [changed] Breaking Change: The
BlockThreshold
enum inSafetySetting
has been renamed toHarmBlockThreshold
. (#13696) - [changed] Breaking Change: The
unspecified
case has been removed from theFinishReason
,BlockReason
andHarmProbability
enums; this scenario is now handled by the existingunknown
case. (#13699) - [changed] Breaking Change: The property
citationSources
ofCitationMetadata
has been renamed tocitations
. (#13702) - [changed] Breaking Change: The initializer for
Schema
is now internal; use the new type methodsSchema.string(...)
,Schema.object(...)
, etc., instead. (#13852) - [changed] Breaking Change: The initializer for
FunctionDeclaration
now accepts an array of optional parameters instead of a list of required parameters; if a parameter is not listed as optional it is assumed to be required. (#13616) - [changed] Breaking Change:
CountTokensResponse.totalBillableCharacters
is now optional (Int?
); it may benull
in cases such as when aGenerateContentRequest
contains only images or other non-text content. (#13721) - [changed] Breaking Change: The
ImageConversionError
enum is no longer public; image conversion errors are still reported asGenerateContentError.promptImageContentError
. (#13735) - [changed] Breaking Change: The
CountTokensError
enum has been removed; errors occurring inGenerativeModel.countTokens(...)
are now thrown directly instead of being wrapped in aCountTokensError.internalError
. (#13736) - [changed] Breaking Change: The enum
ModelContent.Part
has been replaced with a protocol namedPart
to avoid future breaking changes with new part types. The new typesTextPart
andFunctionCallPart
may be received when generating content; additionally the typesInlineDataPart
,FileDataPart
andFunctionResponsePart
may be provided as input. (#13767) - [changed] Breaking Change: All initializers for
ModelContent
now require the labelparts:
. (#13832) - [changed] Breaking Change:
HarmCategory
,HarmProbability
, andFinishReason
are now structs instead of enums types and theunknown
cases have been removed; in aswitch
statement, use thedefault:
case to cover unknown or unhandled values. (#13728, #13854, #13860) - [changed] Breaking Change: The
Tool
initializer is now internal; use the new type methodfunctionDeclarations(_:)
to create aTool
for function calling. (#13873) - [changed] Breaking Change: The
FunctionCallingConfig
initializer andMode
enum are now internal; use one of the new type methodsauto()
,any(allowedFunctionNames:)
, ornone()
to create a config. (#13873) - [changed] Breaking Change: The
CandidateResponse
type is now namedCandidate
. (#13897) - [changed] Breaking Change: The minimum deployment target for the SDK is now macOS 12.0; all other platform minimums remain the same at iOS 15.0, macCatalyst 15.0, tvOS 15.0, and watchOS 8.0. (#13903)
- [changed] Breaking Change: All of the public properties of
GenerationConfig
are nowinternal
; they all remain configurable in the initializer. (#13904) - [changed] The default request timeout is now 180 seconds instead of the
platform-default value of 60 seconds for a
URLRequest
; this timeout may still be customized inRequestOptions
. (#13722) - [changed] The response from
GenerativeModel.countTokens(...)
now includessystemInstruction
,tools
andgenerationConfig
in thetotalTokens
andtotalBillableCharacters
counts, where applicable. (#13813) - [added] Added a new
HarmCategory
.civicIntegrity
for filtering content that may be used to harm civic integrity. (#13728) - [added] Added
probabilityScore
,severity
andseverityScore
inSafetyRating
to provide more fine-grained detail on blocked responses. (#13875) - [added] Added a new
HarmBlockThreshold
.off
, which turns off the safety filter. (#13863) - [added] Added an optional
HarmBlockMethod
parametermethod
inSafetySetting
that configures whether responses are blocked based on theprobability
and/orseverity
of content being in aHarmCategory
. (#13876) - [added] Added new
FinishReason
values.blocklist
,.prohibitedContent
,.spii
and.malformedFunctionCall
that may be reported. (#13860) - [added] Added new
BlockReason
values.blocklist
and.prohibitedContent
that may be reported when a prompt is blocked. (#13861) - [added] Added the
PromptFeedback
propertyblockReasonMessage
that may be provided alongside theblockReason
. (#13891) - [added] Added an optional
publicationDate
property that may be provided inCitation
. (#13893) - [added] Added
presencePenalty
andfrequencyPenalty
parameters toGenerationConfig
. (#13899)
- [added] Added
Decodable
conformance forFunctionResponse
. (#13606) - [changed] Breaking Change: Reverted refactor of
GenerativeModel
andChat
as Swift actors (#13545) introduced in 11.2; The methodsgenerateContentStream
,startChat
andsendMessageStream
no longer need to be called withawait
. (#13703)
- [fixed] Resolved a decoding error for citations without a
uri
and added support for decodingtitle
fields, which were previously ignored. (#13518) - [changed] Breaking Change: The methods for starting streaming requests
(
generateContentStream
andsendMessageStream
) are now throwing and asynchronous and must be called withtry await
. (#13545, #13573) - [changed] Breaking Change: Creating a chat instance (
startChat
) is now asynchronous and must be called withawait
. (#13545) - [changed] Breaking Change: The source image in the
ImageConversionError.couldNotConvertToJPEG
error case is now an enum value instead of theAny
type. (#13575) - [added] Added support for specifying a JSON
responseSchema
inGenerationConfig
; see control generated output for more details. (#13576)
- [feature] Added community support for watchOS. (#13215)
- [changed] Removed uses of the
gemini-1.5-flash-preview-0514
model in docs and samples. Developers should now use the auto-updated versions,gemini-1.5-pro
orgemini-1.5-flash
, or a specific stable version; see available model names for more details. (#13099) - [feature] Added community support for tvOS and visionOS. (#13090, #13092)
- [changed] Removed uses of the
gemini-1.5-pro-preview-0409
model in docs and samples. Developers should now usegemini-1.5-pro-preview-0514
orgemini-1.5-flash-preview-0514
; see available model names for more details. (#12979) - [changed] Logged additional details when required APIs for Vertex AI are not enabled or response payloads when requests fail. (#13007, #13009)
- [feature] Initial release of the Vertex AI for Firebase SDK (public preview). Learn how to get started with the SDK in your app.