[bugfix] Fix issue when llm config is not defined (#763)
This commit is contained in:
@@ -19,11 +19,13 @@ class TestImageChunker(unittest.TestCase):
|
||||
image_path = "./tmp/image.jpeg"
|
||||
result = chunker.create_chunks(MockLoader(), image_path)
|
||||
|
||||
expected_chunks = {'doc_id': '123',
|
||||
'documents': [image_path],
|
||||
'embeddings': ['embedding'],
|
||||
'ids': ['140bedbf9c3f6d56a9846d2ba7088798683f4da0c248231336e6a05679e4fdfe'],
|
||||
'metadatas': [{'data_type': 'images', 'doc_id': '123', 'url': 'none'}]}
|
||||
expected_chunks = {
|
||||
"doc_id": "123",
|
||||
"documents": [image_path],
|
||||
"embeddings": ["embedding"],
|
||||
"ids": ["140bedbf9c3f6d56a9846d2ba7088798683f4da0c248231336e6a05679e4fdfe"],
|
||||
"metadatas": [{"data_type": "images", "doc_id": "123", "url": "none"}],
|
||||
}
|
||||
self.assertEqual(expected_chunks, result)
|
||||
|
||||
def test_chunks_with_default_config(self):
|
||||
@@ -37,11 +39,13 @@ class TestImageChunker(unittest.TestCase):
|
||||
image_path = "./tmp/image.jpeg"
|
||||
result = chunker.create_chunks(MockLoader(), image_path)
|
||||
|
||||
expected_chunks = {'doc_id': '123',
|
||||
'documents': [image_path],
|
||||
'embeddings': ['embedding'],
|
||||
'ids': ['140bedbf9c3f6d56a9846d2ba7088798683f4da0c248231336e6a05679e4fdfe'],
|
||||
'metadatas': [{'data_type': 'images', 'doc_id': '123', 'url': 'none'}]}
|
||||
expected_chunks = {
|
||||
"doc_id": "123",
|
||||
"documents": [image_path],
|
||||
"embeddings": ["embedding"],
|
||||
"ids": ["140bedbf9c3f6d56a9846d2ba7088798683f4da0c248231336e6a05679e4fdfe"],
|
||||
"metadatas": [{"data_type": "images", "doc_id": "123", "url": "none"}],
|
||||
}
|
||||
self.assertEqual(expected_chunks, result)
|
||||
|
||||
def test_word_count(self):
|
||||
|
||||
Reference in New Issue
Block a user