Skip to content

Commit

Permalink
[Vertex AI] Remove format for double() Schema (#13990)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewheard authored Nov 5, 2024
1 parent ba7325c commit 1cdba8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
3 changes: 3 additions & 0 deletions FirebaseVertexAI/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- [fixed] Fixed an issue where `VertexAI.vertexAI(app: app1)` and
`VertexAI.vertexAI(app: app2)` would return the same instance if their
`location` was the same, including the default `us-central1`. (#14007)
- [changed] Removed `format: "double"` in `Schema.double()` since
double-precision accuracy isn't enforced by the model; continue using the
Swift `Double` type when decoding data produced with this schema. (#13990)

# 11.4.0
- [feature] Vertex AI in Firebase is now Generally Available (GA) and can be
Expand Down
12 changes: 3 additions & 9 deletions FirebaseVertexAI/Sources/Types/Public/Schema.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,10 @@ public class Schema {
)
}

/// Returns a `Schema` representing a double-precision floating-point number.
/// Returns a `Schema` representing a floating-point number.
///
/// This schema instructs the model to produce data of type `"NUMBER"` with the `format`
/// `"double"`, which is suitable for decoding into a Swift `Double` (or `Double?`, if `nullable`
/// is set to `true`).
///
/// > Important: This `Schema` provides a hint to the model that it should generate a
/// > double-precision floating-point number, a `double`, but only guarantees that the value will
/// > be a number.
/// This schema instructs the model to produce data of type `"NUMBER"`, which is suitable for
/// decoding into a Swift `Double` (or `Double?`, if `nullable` is set to `true`).
///
/// - Parameters:
/// - description: An optional description of what the number should contain or represent; may
Expand All @@ -202,7 +197,6 @@ public class Schema {
public static func double(description: String? = nil, nullable: Bool = false) -> Schema {
return self.init(
type: .number,
format: "double",
description: description,
nullable: nullable
)
Expand Down

0 comments on commit 1cdba8e

Please sign in to comment.