Values

Sending and receiving data to and from predictors.

"""
Prediction value.
"""
type Value {
...
}

Values are any data consumed or produced by a predictor.

The Value Type

Function represent values with a URL that points to the value data, along with type and shape information. Function also provides convenience fields for accessing the value as plain types.

Accessing the Value Data

"""
Value data URL.
"""
data: URL

The data field holds a URL that points to the value data.

This is either a web (https://) or data (data:) URL.

This is null when the value type is null.

Inspecting the Value Type

"""
Value type.
"""
type: Dtype!

Every value specifies its type. This information is critical in serializing and deserializing values when making predictions.

Inspecting the Value Shape

"""
Value shape.
"""
shape: [Int!]

The shape is populated for all numerical values. For tensor values, the shape provides crucial information used to serialize and deserialize the value into a numpy ndarray for prediction.

This is null if shape information is not available or applicable.

Accessing the String Value

"""
Value as a `string`.
"""
stringValue: String

This is a convenience property and is only populated for string values.

Accessing the Float Value

"""
Value as a `float`.
"""
floatValue: Float

This is a convenience property and is only populated for float32 or float64 scalar values.

Accessing the Float Array

"""
Value as a flattened `float` array.
"""
floatArray: [Float!]

This is a convenience property and is only populated for float32 tensor values.

Accessing the Integer Value

"""
Value as an integer.
"""
intValue: Int

This is a convenience property and is only populated for integer scalar values.

Accessing the Integer Array

"""
Value as a flattened `int32` array.
"""
intArray: [Int!]

This is a convenience property and is only populated for int32 tensor values.

Accessing the Boolean Value

"""
Value as a boolean.
"""
boolValue: Boolean

This is a convenience property and is only populated for bool scalar values.

Accessing the Boolean Array

"""
Value as a flattened boolean array.
"""
boolArray: [Boolean!]

This is a convenience property and is only populated for bool tensor values.

Accessing the List Value

"""
Value as a list.
"""
listValue: JSON

This is a convenience property and is only populated for list values.

Accessing the Dictionary Value

"""
Value as a dictionary.
"""
dictValue: JSONObject

This is a convenience property and is only populated for dict values.

Data Types in Function

Function supports a fixed set of data types, which are used for serializing and deserializing values during predictions. These are contained in the Dtype scalar type:

DtypePython TypeSerializationNotes
nullNoneNone
float16float or ndarrayRaw bytesPython type depends on shape
float32float or ndarrayRaw bytesPython type depends on shape
float64float or ndarrayRaw bytesPython type depends on shape
int8int or ndarrayRaw bytesPython type depends on shape
int16int or ndarrayRaw bytesPython type depends on shape
int32int or ndarrayRaw bytesPython type depends on shape
int64int or ndarrayRaw bytesPython type depends on shape
uint8int or ndarrayRaw bytesPython type depends on shape
uint16int or ndarrayRaw bytesPython type depends on shape
uint32int or ndarrayRaw bytesPython type depends on shape
uint64int or ndarrayRaw bytesPython type depends on shape
boolbool or ndarrayRaw bytesPython type depends on shape
stringstrUTF-8 bytes
listlistJSON string
dictdictJSON string
imagePIL.ImageUser-defined
videoPathUser-definedPredictor receives video Path.
audioPathUser-definedPredictor receives audio Path.
modelPathUser-definedPredictor receives 3D model Path.
binaryPathUser-definedPredictor receives binary Path.
Previous
Predictions