Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions FirebaseAI/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@

To start using the new SDK, import the `FirebaseAI` module and use the
top-level `FirebaseAI` class. See details in the [migration guide
](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk).
](https://firebase.google.com/docs/ai-logic/migrate-to-latest-sdk).
Comment thread
paulb777 marked this conversation as resolved.
- [fixed] Fixed `ModalityTokenCount` decoding when the `tokenCount` field is
omitted; this occurs when the count is 0. (#14745)
- [fixed] Fixed `Candidate` decoding when `SafetyRating` values are missing a
Expand Down Expand Up @@ -229,7 +229,7 @@

# 11.9.0
- [feature] **Public Preview**: Added support for
[generating images](https://firebase.google.com/docs/vertex-ai/generate-images-imagen?platform=ios)
[generating images](https://firebase.google.com/docs/ai-logic/generate-images-imagen?platform=ios)
using the Imagen 3 models.
<br /><br />
Note: This feature is in Public Preview, which means that it is not subject to
Expand Down Expand Up @@ -263,9 +263,9 @@
Carthage distributions.
<br /><br />
- If you're new to this library, visit the
[getting started guide](http://firebase.google.com/docs/vertex-ai/get-started?platform=ios).
[getting started guide](https://firebase.google.com/docs/ai-logic/get-started?platform=ios).
- If you used the preview version of the library, visit the
[migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-ga?platform=ios)
[migration guide](https://firebase.google.com/docs/ai-logic/migrate-to-ga?platform=ios)
to learn about some important updates.
- [changed] **Breaking Change**: The `HarmCategory` enum is no longer nested
inside the `SafetySetting` struct and the `unspecified` case has been
Expand Down Expand Up @@ -366,7 +366,7 @@
instead of the `Any` type. (#13575)
- [added] Added support for specifying a JSON `responseSchema` in
`GenerationConfig`; see
[control generated output](https://firebase.google.com/docs/vertex-ai/structured-output?platform=ios)
[control generated output](https://firebase.google.com/docs/ai-logic/structured-output?platform=ios)
for more details. (#13576)

# 10.29.0
Expand All @@ -376,21 +376,21 @@
- [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` or `gemini-1.5-flash`, or a specific stable version; see
[available model names](https://firebase.google.com/docs/vertex-ai/gemini-models#available-model-names)
[available model names](https://firebase.google.com/docs/ai-logic/models#available-model-names)
for more details. (#13099)
- [feature] Added community support for tvOS and visionOS. (#13090, #13092)

# 10.27.0
- [changed] Removed uses of the `gemini-1.5-pro-preview-0409` model in docs and
samples. Developers should now use `gemini-1.5-pro-preview-0514` or
`gemini-1.5-flash-preview-0514`; see
[available model names](https://firebase.google.com/docs/vertex-ai/gemini-models#available-model-names)
[available model names](https://firebase.google.com/docs/ai-logic/models#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)

# 10.26.0
- [feature] Initial release of the Vertex AI for Firebase SDK (public preview).
Learn how to
[get started](https://firebase.google.com/docs/vertex-ai/get-started?platform=ios)
[get started](https://firebase.google.com/docs/ai-logic/get-started?platform=ios)
with the SDK in your app.
16 changes: 8 additions & 8 deletions FirebaseAI/Sources/FirebaseAI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ public final class FirebaseAI: Sendable {

/// Initializes a generative model with the given parameters.
///
/// - Note: Refer to [Gemini models](https://firebase.google.com/docs/vertex-ai/gemini-models) for
/// - Note: Refer to [Gemini models](https://firebase.google.com/docs/ai-logic/models) for
/// guidance on choosing an appropriate model for your use case.
///
/// - Parameters:
/// - modelName: The name of the model to use; see
/// [available model names
/// ](https://firebase.google.com/docs/vertex-ai/gemini-models#available-model-names) for a
/// ](https://firebase.google.com/docs/ai-logic/models#available-model-names) for a
/// list of supported model names.
/// - generationConfig: The content generation parameters your model should use.
/// - safetySettings: A value describing what types of harmful content your model should allow.
Expand All @@ -92,7 +92,7 @@ public final class FirebaseAI: Sendable {
&& !modelName.starts(with: GenerativeModel.gemmaModelNamePrefix) {
AILog.warning(code: .unsupportedGeminiModel, """
Unsupported Gemini model "\(modelName)"; see \
https://firebase.google.com/docs/vertex-ai/models for a list supported Gemini model names.
https://firebase.google.com/docs/ai-logic/models for a list of supported Gemini model names.
""")
}

Expand All @@ -119,7 +119,7 @@ public final class FirebaseAI: Sendable {
///
/// - Parameters:
/// - name: The name of the model to use; see [available model names
/// ](https://firebase.google.com/docs/vertex-ai/gemini-models#available-model-names)
/// ](https://firebase.google.com/docs/ai-logic/models#available-model-names)
/// for a list of supported model names.
/// - safetySettings: Settings to adjust the safety filters for potentially harmful content
/// generated by the model.
Expand All @@ -143,7 +143,7 @@ public final class FirebaseAI: Sendable {
///
/// - Parameters:
/// - model: The name of the model to use; see [available model names
/// ](https://firebase.google.com/docs/vertex-ai/gemini-models#available-model-names)
/// ](https://firebase.google.com/docs/ai-logic/models#available-model-names)
/// for a list of supported model names.
/// - tools: A list of tools that extend the capabilities of the model. These are typically
/// native Gemini ``FirebaseAILogic/Tool``s, such as ``ToolRepresentable/googleSearch(_:)``,
Expand All @@ -168,7 +168,7 @@ public final class FirebaseAI: Sendable {
///
/// - Parameters:
/// - model: The name of the model to use; see [available model names
/// ](https://firebase.google.com/docs/vertex-ai/gemini-models#available-model-names)
/// ](https://firebase.google.com/docs/ai-logic/models#available-model-names)
/// for a list of supported model names.
/// - tools: A list of tools that extend the capabilities of the model. These tools must be
/// instances conforming to `FoundationModels.Tool` for automatic function calling.
Expand Down Expand Up @@ -310,7 +310,7 @@ public final class FirebaseAI: Sendable {
.allSatisfy({ !$0.isWhitespace && !$0.isNewline && $0 != "/" }) else {
fatalError("""
Invalid model name "\(modelName)" specified; see \
https://firebase.google.com/docs/vertex-ai/gemini-model#available-models for a list of \
https://firebase.google.com/docs/ai-logic/models#available-model-names for a list of \
available models.
""")
}
Expand All @@ -328,7 +328,7 @@ public final class FirebaseAI: Sendable {
.allSatisfy({ !$0.isWhitespace && !$0.isNewline && $0 != "/" }) else {
fatalError("""
Invalid location "\(location)" specified; see \
https://firebase.google.com/docs/vertex-ai/locations?platform=ios#available-locations \
https://firebase.google.com/docs/ai-logic/locations?platform=ios#available-locations \
for a list of available locations.
""")
}
Expand Down
4 changes: 2 additions & 2 deletions FirebaseAI/Sources/GenerateContentResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public struct FinishReason: DecodableProtoEnum, Hashable, Sendable {
/// Returns the raw string representation of the `FinishReason` value.
///
/// > Note: This value directly corresponds to the values in the [REST
/// > API](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/GenerateContentResponse#FinishReason).
/// > API](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/rest#FinishReason).
public let rawValue: String

static let unrecognizedValueMessageCode =
Expand Down Expand Up @@ -401,7 +401,7 @@ public struct PromptFeedback: Sendable {
/// Returns the raw string representation of the `BlockReason` value.
///
/// > Note: This value directly corresponds to the values in the [REST
/// > API](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/GenerateContentResponse#BlockedReason).
/// > API](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/rest#BlockedReason).
public let rawValue: String

static let unrecognizedValueMessageCode =
Expand Down
24 changes: 12 additions & 12 deletions FirebaseAI/Sources/GenerationConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ public struct GenerationConfig: Sendable, Equatable {
/// Creates a new `GenerationConfig` value.
///
/// See the
/// [Configure model parameters](https://firebase.google.com/docs/vertex-ai/model-parameters)
/// [Configure model parameters](https://firebase.google.com/docs/ai-logic/model-parameters)
/// guide and the
/// [Cloud documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#generationconfig)
/// [Cloud documentation](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/models/inference#generationconfig)
/// for more details.
///
/// - Parameters:
/// - maxOutputTokens: Maximum number of tokens that can be generated in the response.
/// See the configure model parameters [documentation](https://firebase.google.com/docs/vertex-ai/model-parameters?platform=ios#max-output-tokens)
/// See the configure model parameters [documentation](https://firebase.google.com/docs/ai-logic/model-parameters?platform=ios#max-output-tokens)
/// for more details.
/// - stopSequences: A set of up to 5 `String`s that will stop output generation. If specified,
/// the API will stop at the first appearance of a stop sequence. The stop sequence will not
/// be included as part of the response. See the
/// [Cloud documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#generationconfig)
/// [Cloud documentation](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/models/inference#generationconfig)
/// for more details.
/// - responseMIMEType: Output response MIME type of the generated candidate text.
///
Expand All @@ -96,12 +96,12 @@ public struct GenerationConfig: Sendable, Equatable {
///
/// Refer to the
/// [Generate structured
/// output](https://firebase.google.com/docs/vertex-ai/structured-output?platform=ios) guide
/// output](https://firebase.google.com/docs/ai-logic/structured-output?platform=ios) guide
Comment on lines 98 to +99

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Splitting the markdown link text and its URL across lines can cause rendering issues in Xcode Quick Help. Keeping the link text and URL together on a single line improves documentation readability and rendering.

Suggested change
/// [Generate structured
/// output](https://firebase.google.com/docs/vertex-ai/structured-output?platform=ios) guide
/// output](https://firebase.google.com/docs/ai-logic/structured-output?platform=ios) guide
/// [Generate structured output](https://firebase.google.com/docs/ai-logic/structured-output?platform=ios)
/// guide

/// for more details.
/// - responseModalities: The data types (modalities) that may be returned in model responses.
///
/// See the [multimodal
/// responses](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal-response-generation)
/// responses](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/image-generation)
/// documentation for more details.
///
/// > Warning: Specifying response modalities is a **Public Preview** feature, which means
Expand Down Expand Up @@ -150,19 +150,19 @@ public struct GenerationConfig: Sendable, Equatable {
/// Creates a new `GenerationConfig` value without deprecated tuning parameters.
///
/// See the
/// [Configure model parameters](https://firebase.google.com/docs/vertex-ai/model-parameters)
/// [Configure model parameters](https://firebase.google.com/docs/ai-logic/model-parameters)
/// guide and the
/// [Cloud documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#generationconfig)
/// [Cloud documentation](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/models/inference#generationconfig)
/// for more details.
///
/// - Parameters:
/// - maxOutputTokens: Maximum number of tokens that can be generated in the response.
/// See the configure model parameters [documentation](https://firebase.google.com/docs/vertex-ai/model-parameters?platform=ios#max-output-tokens)
/// See the configure model parameters [documentation](https://firebase.google.com/docs/ai-logic/model-parameters?platform=ios#max-output-tokens)
/// for more details.
/// - stopSequences: A set of up to 5 `String`s that will stop output generation. If specified,
/// the API will stop at the first appearance of a stop sequence. The stop sequence will not
/// be included as part of the response. See the
/// [Cloud documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#generationconfig)
/// [Cloud documentation](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/models/inference#generationconfig)
/// for more details.
/// - responseMIMEType: Output response MIME type of the generated candidate text.
///
Expand All @@ -179,12 +179,12 @@ public struct GenerationConfig: Sendable, Equatable {
///
/// Refer to the
/// [Generate structured
/// output](https://firebase.google.com/docs/vertex-ai/structured-output?platform=ios) guide
/// output](https://firebase.google.com/docs/ai-logic/structured-output?platform=ios) guide
Comment on lines 181 to +182

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Splitting the markdown link text and its URL across lines can cause rendering issues in Xcode Quick Help. Keeping the link text and URL together on a single line improves documentation readability and rendering.

Suggested change
/// [Generate structured
/// output](https://firebase.google.com/docs/vertex-ai/structured-output?platform=ios) guide
/// output](https://firebase.google.com/docs/ai-logic/structured-output?platform=ios) guide
/// [Generate structured output](https://firebase.google.com/docs/ai-logic/structured-output?platform=ios)
/// guide

/// for more details.
/// - responseModalities: The data types (modalities) that may be returned in model responses.
///
/// See the [multimodal
/// responses](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal-response-generation)
/// responses](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/image-generation)
/// documentation for more details.
///
/// > Warning: Specifying response modalities is a **Public Preview** feature, which means
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
///
/// - Parameters:
/// - name: The name of the model to use; see [available model names
/// ](https://firebase.google.com/docs/vertex-ai/gemini-models#available-model-names)
/// ](https://firebase.google.com/docs/ai-logic/models#available-model-names)
/// for a list of supported model names.
/// - safetySettings: Settings to adjust the safety filters for potentially harmful content
/// generated by the model.
Expand Down
14 changes: 7 additions & 7 deletions FirebaseAI/Sources/Safety.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public struct SafetyRating: Equatable, Hashable, Sendable {
///
/// The probability safety score is a confidence score between 0.0 and 1.0, rounded to one decimal
/// place; it is discretized into a ``HarmProbability`` in ``probability``. See [probability
/// scores](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#comparison_of_probability_scores_and_severity_scores)
/// scores](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/configure-safety-filters#comparison_of_probability_scores_and_severity_scores)
/// in the Google Cloud documentation for more details.
public let probabilityScore: Float

Expand All @@ -48,7 +48,7 @@ public struct SafetyRating: Equatable, Hashable, Sendable {
/// The severity score is the magnitude of how harmful a model response might be.
///
/// The severity score ranges from 0.0 to 1.0, rounded to one decimal place; it is discretized
/// into a ``HarmSeverity`` in ``severity``. See [severity scores](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#comparison_of_probability_scores_and_severity_scores)
/// into a ``HarmSeverity`` in ``severity``. See [severity scores](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/configure-safety-filters#comparison_of_probability_scores_and_severity_scores)
/// in the Google Cloud documentation for more details.
public let severityScore: Float

Expand Down Expand Up @@ -105,7 +105,7 @@ public struct SafetyRating: Equatable, Hashable, Sendable {
/// Returns the raw string representation of the `HarmProbability` value.
///
/// > Note: This value directly corresponds to the values in the [REST
/// > API](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/GenerateContentResponse#SafetyRating).
/// > API](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/rest#SafetyRating).
public let rawValue: String

static let unrecognizedValueMessageCode =
Expand Down Expand Up @@ -140,7 +140,7 @@ public struct SafetyRating: Equatable, Hashable, Sendable {
/// Returns the raw string representation of the `HarmSeverity` value.
///
/// > Note: This value directly corresponds to the values in the [REST
/// > API](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/GenerateContentResponse#HarmSeverity).
/// > API](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/rest#HarmSeverity).
public let rawValue: String

static let unrecognizedValueMessageCode =
Expand All @@ -152,7 +152,7 @@ public struct SafetyRating: Equatable, Hashable, Sendable {
/// fallback response instead of generated content.
///
/// See [safety settings for Gemini
/// models](https://firebase.google.com/docs/vertex-ai/safety-settings?platform=ios#gemini) for
/// models](https://firebase.google.com/docs/ai-logic/safety-settings?platform=ios#gemini) for
/// more details.
public struct SafetySetting: Sendable, Hashable {
/// Block at and beyond a specified ``SafetyRating/HarmProbability``.
Expand Down Expand Up @@ -221,7 +221,7 @@ public struct SafetySetting: Sendable, Hashable {
/// - threshold: The threshold describing what content should be blocked.
/// - method: The method of computing whether the threshold has been exceeded; if not specified,
/// the default method is ``HarmBlockMethod/severity`` for most models. See [harm block
/// methods](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#how_to_configure_safety_filters)
/// methods](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/configure-safety-filters#how_to_configure_safety_filters)
/// in the Google Cloud documentation for more details.
/// > Note: For models older than `gemini-1.5-flash` and `gemini-1.5-pro`, the default method
/// > is ``HarmBlockMethod/probability``.
Expand Down Expand Up @@ -265,7 +265,7 @@ public struct HarmCategory: CodableProtoEnum, Hashable, Sendable {
/// Returns the raw string representation of the `HarmCategory` value.
///
/// > Note: This value directly corresponds to the values in the
/// > [REST API](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/HarmCategory).
/// > [REST API](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/rest).
public let rawValue: String

static let unrecognizedValueMessageCode =
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Sources/Tool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public extension ToolRepresentable where Self == FirebaseAILogic.Tool {
/// was trained (for example, the current date or weather conditions) or to allow it to interact
/// with external systems (for example, making an API request or querying/updating a database).
/// For more details and use cases, see [Function calling using the Gemini
/// API](http://firebase.google.com/docs/vertex-ai/function-calling?platform=ios).
/// API](https://firebase.google.com/docs/ai-logic/function-calling?platform=ios).
///
/// - Parameters:
/// - functionDeclarations: A list of `FunctionDeclarations` available to the model that can be
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Sources/Types/Internal/ProtoDate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Foundation
/// - A year and month value, with a zero day, such as a credit card expiration date
///
/// This represents a
/// [`google.type.Date`](https://cloud.google.com/vertex-ai/docs/reference/rest/Shared.Types/Date).
/// [`google.type.Date`](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/rest/Shared.Types/Date).
struct ProtoDate {
/// Year of the date.
///
Expand Down
Loading
Loading