Floating Point Values
Floating Point Values
Floating-point input and return values should be annotated with the For control over the binary width of the number, use the
float built-in type.numpy.float[16,32,64] types:Integer Values
Integer Values
Integer input and return values should be annotated with the For control over the binary width of the integer, use the
int built-in type.numpy.int[8,16,32,64] types:Boolean Values
Boolean Values
Boolean input and return values must be annotated with the
bool built-in type.Tensor Values
Tensor Values
Tensor input and return values must be annotated with the NumPy Below are the supported element types:
numpy.typing.NDArray[T] type, where T is
the tensor element type.String Values
String Values
String input and return values must be annotated with the
str built-in type.List Values
List Values
List input and return values must be annotated with the
list[T] built-in type, where T is the element type.Providing an element type
T is optional but strongly recommended because it is used to generate a schema for the parameter or
return value.Dictionary Values
Dictionary Values
Dictionary input and return values can be annotated in one of two ways:
- Using a Pydantic
BaseModelsubclass. - Using the
dict[str, T]built-in type.
Image Values
Image Values
Image input and return values must be annotated with the Pillow
PIL.Image.Image type.Binary Values
Binary Values
Binary input and return values can be annotated in one of three ways:
- Using the
bytesbuilt-in type. - Using the
bytearraybuilt-in type. - Using the
io.BytesIOtype.