Fact.fromJson constructor

Fact.fromJson(
  1. Object? j
)

Implementation

factory Fact.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Fact(
    query: switch (json['query']) {
      null => null,
      Object $1 => decodeString($1),
    },
    title: switch (json['title']) {
      null => null,
      Object $1 => decodeString($1),
    },
    uri: switch (json['uri']) {
      null => null,
      Object $1 => decodeString($1),
    },
    summary: switch (json['summary']) {
      null => null,
      Object $1 => decodeString($1),
    },
    vectorDistance: switch (json['vectorDistance']) {
      null => null,
      Object $1 => decodeDouble($1),
    },
    score: switch (json['score']) {
      null => null,
      Object $1 => decodeDouble($1),
    },
    chunk: switch (json['chunk']) {
      null => null,
      Object $1 => RagChunk.fromJson($1),
    },
  );
}