StreamingPredictRequest.fromJson constructor

StreamingPredictRequest.fromJson(
  1. Object? j
)

Implementation

factory StreamingPredictRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return StreamingPredictRequest(
    endpoint: switch (json['endpoint']) {
      null => '',
      Object $1 => decodeString($1),
    },
    inputs: switch (json['inputs']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Tensor.fromJson(i)],
      _ => throw const FormatException('"inputs" is not a list'),
    },
    parameters: switch (json['parameters']) {
      null => null,
      Object $1 => Tensor.fromJson($1),
    },
  );
}