EmbeddingChunk.fromJson constructor

EmbeddingChunk.fromJson(
  1. Map<String, Object?> json
)

Creates a chunk from JSON

Implementation

factory EmbeddingChunk.fromJson(Map<String, Object?> json) {
  return EmbeddingChunk(
    docId: json['doc_id'] as String,
    chunkId: json['chunk_id'] as int,
    cleanContent: json['clean_content'] as String,
    vector: (json['vector'] as List).cast<double>(),
    metadata: json['metadata'] as Map<String, Object?>? ?? {},
  );
}