Remove passing of metadata_id to DocumentChunk

This commit is contained in:
Leon Luithlen 2024-11-27 12:22:28 +01:00
parent 80517f5117
commit aacba555c9

View file

@ -34,8 +34,7 @@ class TextChunker():
word_count = chunk_data["word_count"], word_count = chunk_data["word_count"],
is_part_of = self.document, is_part_of = self.document,
chunk_index = self.chunk_index, chunk_index = self.chunk_index,
cut_type = chunk_data["cut_type"], cut_type = chunk_data["cut_type"]
metadata_id = self.document.metadata_id
) )
paragraph_chunks = [] paragraph_chunks = []
self.chunk_size = 0 self.chunk_size = 0
@ -48,8 +47,7 @@ class TextChunker():
word_count = self.chunk_size, word_count = self.chunk_size,
is_part_of = self.document, is_part_of = self.document,
chunk_index = self.chunk_index, chunk_index = self.chunk_index,
cut_type = paragraph_chunks[len(paragraph_chunks) - 1]["cut_type"], cut_type = paragraph_chunks[len(paragraph_chunks) - 1]["cut_type"]
metadata_id = self.document.metadata_id
) )
except Exception as e: except Exception as e:
print(e) print(e)
@ -66,8 +64,7 @@ class TextChunker():
word_count = self.chunk_size, word_count = self.chunk_size,
is_part_of = self.document, is_part_of = self.document,
chunk_index = self.chunk_index, chunk_index = self.chunk_index,
cut_type = paragraph_chunks[len(paragraph_chunks) - 1]["cut_type"], cut_type = paragraph_chunks[len(paragraph_chunks) - 1]["cut_type"]
metadata_id = self.document.metadata_id
) )
except Exception as e: except Exception as e:
print(e) print(e)