这是indexloc提供的服务,不要输入任何密码
Skip to content

[Vertex AI] Remove format for double() Schema #13990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 5, 2024
Merged
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
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
Loading