VertexRagStore.fromJson constructor

VertexRagStore.fromJson(
  1. Object? j
)

Implementation

factory VertexRagStore.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return VertexRagStore(
    ragCorpora: switch (json['ragCorpora']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"ragCorpora" is not a list'),
    },
    ragResources: switch (json['ragResources']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) VertexRagStore_RagResource.fromJson(i),
      ],
      _ => throw const FormatException('"ragResources" is not a list'),
    },
    similarityTopK: switch (json['similarityTopK']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    vectorDistanceThreshold: switch (json['vectorDistanceThreshold']) {
      null => null,
      Object $1 => decodeDouble($1),
    },
    ragRetrievalConfig: switch (json['ragRetrievalConfig']) {
      null => null,
      Object $1 => RagRetrievalConfig.fromJson($1),
    },
    storeContext: switch (json['storeContext']) {
      null => false,
      Object $1 => decodeBool($1),
    },
  );
}