EmbedContentRequest.fromJson constructor

EmbedContentRequest.fromJson(
  1. Object? j
)

Implementation

factory EmbedContentRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return EmbedContentRequest(
    model: switch (json['model']) {
      null => '',
      Object $1 => decodeString($1),
    },
    content: switch (json['content']) {
      null => null,
      Object $1 => Content.fromJson($1),
    },
    taskType: switch (json['taskType']) {
      null => null,
      Object $1 => TaskType.fromJson($1),
    },
    title: switch (json['title']) {
      null => null,
      Object $1 => decodeString($1),
    },
    outputDimensionality: switch (json['outputDimensionality']) {
      null => null,
      Object $1 => decodeInt($1),
    },
  );
}