NumberSchema

org.llm4s.toolapi.NumberSchema
See theNumberSchema companion object
@Stable
final case class NumberSchema extends SchemaDefinition[Double]

Number schema (floating-point) with range and divisibility constraints.

Value parameters

description

Human-readable description shown to the LLM

exclusiveMaximum

Exclusive upper bound

exclusiveMinimum

Exclusive lower bound

isInteger

When true the JSON type is "integer" instead of "number"

maximum

Inclusive upper bound

minimum

Inclusive lower bound

multipleOf

Value must be a multiple of this number

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait SchemaDefinition[Double]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def toJsonSchema(strict: Boolean): Value

Serialise this schema to a JSON Schema ujson.Value.

Serialise this schema to a JSON Schema ujson.Value.

Value parameters

strict

When true, all object properties are treated as required, matching OpenAI strict-mode tool definitions.

Attributes

def withDescription(description: String): NumberSchema

Replace the description shown to the LLM.

Replace the description shown to the LLM.

Attributes

Set the exclusive upper bound.

Set the exclusive upper bound.

Attributes

def withExclusiveMaximum(max: Option[Double]): NumberSchema

Set or clear the exclusive upper bound.

Set or clear the exclusive upper bound.

Attributes

Set the exclusive lower bound.

Set the exclusive lower bound.

Attributes

def withExclusiveMinimum(min: Option[Double]): NumberSchema

Set or clear the exclusive lower bound.

Set or clear the exclusive lower bound.

Attributes

def withExclusiveRange(min: Option[Double], max: Option[Double]): NumberSchema

Add exclusive minimum and/or maximum range constraints.

Add exclusive minimum and/or maximum range constraints.

Value parameters

max

Optional exclusive upper bound

min

Optional exclusive lower bound

Attributes

def withIsInteger(isInteger: Boolean): NumberSchema

When true the JSON type is "integer" instead of "number".

When true the JSON type is "integer" instead of "number".

Attributes

def withMaximum(max: Double): NumberSchema

Set the inclusive upper bound.

Set the inclusive upper bound.

Attributes

def withMaximum(max: Option[Double]): NumberSchema

Set or clear the inclusive upper bound.

Set or clear the inclusive upper bound.

Attributes

def withMinimum(min: Double): NumberSchema

Set the inclusive lower bound.

Set the inclusive lower bound.

Attributes

def withMinimum(min: Option[Double]): NumberSchema

Set or clear the inclusive lower bound.

Set or clear the inclusive lower bound.

Attributes

def withMultipleOf(multiple: Double): NumberSchema

Require the value to be an integer multiple of multiple.

Require the value to be an integer multiple of multiple.

Value parameters

multiple

The divisor

Attributes

def withMultipleOf(multiple: Option[Double]): NumberSchema

Set or clear the divisor the value must be a multiple of.

Set or clear the divisor the value must be a multiple of.

Attributes

def withRange(min: Option[Double], max: Option[Double]): NumberSchema

Add inclusive minimum and/or maximum range constraints.

Add inclusive minimum and/or maximum range constraints.

Value parameters

max

Optional inclusive upper bound

min

Optional inclusive lower bound

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product