Skip to content

Commit

Permalink
add back num but deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
David Motsonashvili committed Jun 17, 2024
1 parent 6008408 commit 1d86d0e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.firebase.vertexai.type

import com.google.firebase.vertexai.type.Schema.Companion.double
import org.json.JSONObject

/**
Expand Down Expand Up @@ -221,6 +222,19 @@ class Schema<T>(
nullable = false,
)

/** Registers a schema for a floating point number */
@Deprecated(
message = "this is being renamed to double",
replaceWith = ReplaceWith("double(name, description)")
)
fun num(name: String, description: String) =
Schema<Double>(
name = name,
description = description,
type = FunctionType.NUMBER,
nullable = false,
)

/** Registers a schema for a floating point number */
fun double(name: String, description: String) =
Schema<Double>(
Expand Down

0 comments on commit 1d86d0e

Please sign in to comment.