Numerical values as denoted more specifically in BAML.

ValueDescription
intInteger
floatFloating point number

We support implicit casting of int -> float, but if you need something to explicitly be a float, use 0.0 instead of 0.

Usage

1function DescribeCircle(radius: int | float, pi: float?) -> string {
2 client "openai/gpt-4o-mini"
3 prompt #"
4 Describe a circle with a radius of {{ radius }} units.
5 Include the area of the circle using pi as {{ pi or 3.14159 }}.
6
7 What are some properties of the circle?
8 "#
9}
10
11test CircleDescription {
12 functions [DescribeCircle]
13 // will be cast to int
14 args { radius 5 }
15}
16
17test CircleDescription2 {
18 functions [DescribeCircle]
19 // will be cast to float
20 args {
21 radius 5.0
22 pi 3.14
23 }
24}