cognee 0.4.0__py3-none-any.whl → 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cognee/infrastructure/databases/vector/embeddings/OllamaEmbeddingEngine.py +4 -1
- cognee/tests/integration/web_url_crawler/test_default_url_crawler.py +1 -1
- cognee/tests/integration/web_url_crawler/test_tavily_crawler.py +1 -1
- cognee/tests/integration/web_url_crawler/test_url_adding_e2e.py +13 -27
- {cognee-0.4.0.dist-info → cognee-0.4.1.dist-info}/METADATA +4 -3
- {cognee-0.4.0.dist-info → cognee-0.4.1.dist-info}/RECORD +10 -10
- {cognee-0.4.0.dist-info → cognee-0.4.1.dist-info}/WHEEL +1 -1
- {cognee-0.4.0.dist-info → cognee-0.4.1.dist-info}/entry_points.txt +0 -0
- {cognee-0.4.0.dist-info → cognee-0.4.1.dist-info}/licenses/LICENSE +0 -0
- {cognee-0.4.0.dist-info → cognee-0.4.1.dist-info}/licenses/NOTICE.md +0 -0
|
@@ -124,7 +124,10 @@ class OllamaEmbeddingEngine(EmbeddingEngine):
|
|
|
124
124
|
self.endpoint, json=payload, headers=headers, timeout=60.0
|
|
125
125
|
) as response:
|
|
126
126
|
data = await response.json()
|
|
127
|
-
|
|
127
|
+
if "embeddings" in data:
|
|
128
|
+
return data["embeddings"][0]
|
|
129
|
+
else:
|
|
130
|
+
return data["data"][0]["embedding"]
|
|
128
131
|
|
|
129
132
|
def get_vector_size(self) -> int:
|
|
130
133
|
"""
|
|
@@ -5,7 +5,7 @@ from cognee.tasks.web_scraper import DefaultUrlCrawler
|
|
|
5
5
|
@pytest.mark.asyncio
|
|
6
6
|
async def test_fetch():
|
|
7
7
|
crawler = DefaultUrlCrawler()
|
|
8
|
-
url = "
|
|
8
|
+
url = "http://example.com/"
|
|
9
9
|
results = await crawler.fetch_urls(url)
|
|
10
10
|
assert len(results) == 1
|
|
11
11
|
assert isinstance(results, dict)
|
|
@@ -11,7 +11,7 @@ skip_in_ci = pytest.mark.skipif(
|
|
|
11
11
|
@skip_in_ci
|
|
12
12
|
@pytest.mark.asyncio
|
|
13
13
|
async def test_fetch():
|
|
14
|
-
url = "
|
|
14
|
+
url = "http://example.com/"
|
|
15
15
|
results = await fetch_with_tavily(url)
|
|
16
16
|
assert isinstance(results, dict)
|
|
17
17
|
assert len(results) == 1
|
|
@@ -14,9 +14,7 @@ async def test_url_saves_as_html_file():
|
|
|
14
14
|
await cognee.prune.prune_system(metadata=True)
|
|
15
15
|
|
|
16
16
|
try:
|
|
17
|
-
original_file_path = await save_data_item_to_storage(
|
|
18
|
-
"https://en.wikipedia.org/wiki/Large_language_model"
|
|
19
|
-
)
|
|
17
|
+
original_file_path = await save_data_item_to_storage("http://example.com/")
|
|
20
18
|
file_path = get_data_file_path(original_file_path)
|
|
21
19
|
assert file_path.endswith(".html")
|
|
22
20
|
file = Path(file_path)
|
|
@@ -44,9 +42,7 @@ async def test_saved_html_is_valid():
|
|
|
44
42
|
await cognee.prune.prune_system(metadata=True)
|
|
45
43
|
|
|
46
44
|
try:
|
|
47
|
-
original_file_path = await save_data_item_to_storage(
|
|
48
|
-
"https://en.wikipedia.org/wiki/Large_language_model"
|
|
49
|
-
)
|
|
45
|
+
original_file_path = await save_data_item_to_storage("http://example.com/")
|
|
50
46
|
file_path = get_data_file_path(original_file_path)
|
|
51
47
|
content = Path(file_path).read_text()
|
|
52
48
|
|
|
@@ -72,7 +68,7 @@ async def test_add_url():
|
|
|
72
68
|
await cognee.prune.prune_data()
|
|
73
69
|
await cognee.prune.prune_system(metadata=True)
|
|
74
70
|
|
|
75
|
-
await cognee.add("
|
|
71
|
+
await cognee.add("http://example.com/")
|
|
76
72
|
|
|
77
73
|
|
|
78
74
|
skip_in_ci = pytest.mark.skipif(
|
|
@@ -88,7 +84,7 @@ async def test_add_url_with_tavily():
|
|
|
88
84
|
await cognee.prune.prune_data()
|
|
89
85
|
await cognee.prune.prune_system(metadata=True)
|
|
90
86
|
|
|
91
|
-
await cognee.add("
|
|
87
|
+
await cognee.add("http://example.com/")
|
|
92
88
|
|
|
93
89
|
|
|
94
90
|
@pytest.mark.asyncio
|
|
@@ -98,7 +94,7 @@ async def test_add_url_without_incremental_loading():
|
|
|
98
94
|
|
|
99
95
|
try:
|
|
100
96
|
await cognee.add(
|
|
101
|
-
"
|
|
97
|
+
"http://example.com/",
|
|
102
98
|
incremental_loading=False,
|
|
103
99
|
)
|
|
104
100
|
except Exception as e:
|
|
@@ -112,7 +108,7 @@ async def test_add_url_with_incremental_loading():
|
|
|
112
108
|
|
|
113
109
|
try:
|
|
114
110
|
await cognee.add(
|
|
115
|
-
"
|
|
111
|
+
"http://example.com/",
|
|
116
112
|
incremental_loading=True,
|
|
117
113
|
)
|
|
118
114
|
except Exception as e:
|
|
@@ -125,7 +121,7 @@ async def test_add_url_can_define_preferred_loader_as_list_of_str():
|
|
|
125
121
|
await cognee.prune.prune_system(metadata=True)
|
|
126
122
|
|
|
127
123
|
await cognee.add(
|
|
128
|
-
"
|
|
124
|
+
"http://example.com/",
|
|
129
125
|
preferred_loaders=["beautiful_soup_loader"],
|
|
130
126
|
)
|
|
131
127
|
|
|
@@ -144,7 +140,7 @@ async def test_add_url_with_extraction_rules():
|
|
|
144
140
|
|
|
145
141
|
try:
|
|
146
142
|
await cognee.add(
|
|
147
|
-
"
|
|
143
|
+
"http://example.com/",
|
|
148
144
|
preferred_loaders={"beautiful_soup_loader": {"extraction_rules": extraction_rules}},
|
|
149
145
|
)
|
|
150
146
|
except Exception as e:
|
|
@@ -163,9 +159,7 @@ async def test_loader_is_none_by_default():
|
|
|
163
159
|
}
|
|
164
160
|
|
|
165
161
|
try:
|
|
166
|
-
original_file_path = await save_data_item_to_storage(
|
|
167
|
-
"https://en.wikipedia.org/wiki/Large_language_model"
|
|
168
|
-
)
|
|
162
|
+
original_file_path = await save_data_item_to_storage("http://example.com/")
|
|
169
163
|
file_path = get_data_file_path(original_file_path)
|
|
170
164
|
assert file_path.endswith(".html")
|
|
171
165
|
file = Path(file_path)
|
|
@@ -196,9 +190,7 @@ async def test_beautiful_soup_loader_is_selected_loader_if_preferred_loader_prov
|
|
|
196
190
|
}
|
|
197
191
|
|
|
198
192
|
try:
|
|
199
|
-
original_file_path = await save_data_item_to_storage(
|
|
200
|
-
"https://en.wikipedia.org/wiki/Large_language_model"
|
|
201
|
-
)
|
|
193
|
+
original_file_path = await save_data_item_to_storage("http://example.com/")
|
|
202
194
|
file_path = get_data_file_path(original_file_path)
|
|
203
195
|
assert file_path.endswith(".html")
|
|
204
196
|
file = Path(file_path)
|
|
@@ -225,9 +217,7 @@ async def test_beautiful_soup_loader_works_with_and_without_arguments():
|
|
|
225
217
|
await cognee.prune.prune_system(metadata=True)
|
|
226
218
|
|
|
227
219
|
try:
|
|
228
|
-
original_file_path = await save_data_item_to_storage(
|
|
229
|
-
"https://en.wikipedia.org/wiki/Large_language_model"
|
|
230
|
-
)
|
|
220
|
+
original_file_path = await save_data_item_to_storage("http://example.com/")
|
|
231
221
|
file_path = get_data_file_path(original_file_path)
|
|
232
222
|
assert file_path.endswith(".html")
|
|
233
223
|
file = Path(file_path)
|
|
@@ -263,9 +253,7 @@ async def test_beautiful_soup_loader_successfully_loads_file_if_required_args_pr
|
|
|
263
253
|
await cognee.prune.prune_system(metadata=True)
|
|
264
254
|
|
|
265
255
|
try:
|
|
266
|
-
original_file_path = await save_data_item_to_storage(
|
|
267
|
-
"https://en.wikipedia.org/wiki/Large_language_model"
|
|
268
|
-
)
|
|
256
|
+
original_file_path = await save_data_item_to_storage("http://example.com/")
|
|
269
257
|
file_path = get_data_file_path(original_file_path)
|
|
270
258
|
assert file_path.endswith(".html")
|
|
271
259
|
file = Path(file_path)
|
|
@@ -302,9 +290,7 @@ async def test_beautiful_soup_loads_file_successfully():
|
|
|
302
290
|
}
|
|
303
291
|
|
|
304
292
|
try:
|
|
305
|
-
original_file_path = await save_data_item_to_storage(
|
|
306
|
-
"https://en.wikipedia.org/wiki/Large_language_model"
|
|
307
|
-
)
|
|
293
|
+
original_file_path = await save_data_item_to_storage("http://example.com/")
|
|
308
294
|
file_path = get_data_file_path(original_file_path)
|
|
309
295
|
assert file_path.endswith(".html")
|
|
310
296
|
original_file = Path(file_path)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognee
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Cognee - is a library for enriching LLM context with a semantic layer for better understanding and reasoning.
|
|
5
5
|
Project-URL: Homepage, https://www.cognee.ai
|
|
6
6
|
Project-URL: Repository, https://github.com/topoteretes/cognee
|
|
@@ -28,7 +28,8 @@ Requires-Dist: gunicorn<24,>=20.1.0
|
|
|
28
28
|
Requires-Dist: instructor<2.0.0,>=1.9.1
|
|
29
29
|
Requires-Dist: jinja2<4,>=3.1.3
|
|
30
30
|
Requires-Dist: kuzu==0.11.3
|
|
31
|
-
Requires-Dist:
|
|
31
|
+
Requires-Dist: lance-namespace<=0.0.21
|
|
32
|
+
Requires-Dist: lancedb<=0.25.3,>=0.24.0
|
|
32
33
|
Requires-Dist: limits<5,>=4.4.1
|
|
33
34
|
Requires-Dist: litellm>=1.76.0
|
|
34
35
|
Requires-Dist: mistralai>=1.9.10
|
|
@@ -249,7 +250,7 @@ Let’s try Cognee in just a few lines of code. For detailed setup and configura
|
|
|
249
250
|
|
|
250
251
|
### Prerequisites
|
|
251
252
|
|
|
252
|
-
- Python 3.10 to 3.
|
|
253
|
+
- Python 3.10 to 3.13
|
|
253
254
|
|
|
254
255
|
### Step 1: Install Cognee
|
|
255
256
|
|
|
@@ -204,7 +204,7 @@ cognee/infrastructure/databases/vector/chromadb/__init__.py,sha256=47DEQpj8HBSa-
|
|
|
204
204
|
cognee/infrastructure/databases/vector/embeddings/EmbeddingEngine.py,sha256=I-FXxTSRtb0y00U5eJr2o8n4j4DcC3_mEjEya70BPQU,1158
|
|
205
205
|
cognee/infrastructure/databases/vector/embeddings/FastembedEmbeddingEngine.py,sha256=r1NTOo2aMwjbb9-yfHCU_IS-VZ9p3ZdRGRKWZmcIpso,4521
|
|
206
206
|
cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py,sha256=_rSMGNPjjfrV7Xr2xZWvs1RPRVF1nj-1nlBk0cGgh9A,8321
|
|
207
|
-
cognee/infrastructure/databases/vector/embeddings/OllamaEmbeddingEngine.py,sha256=
|
|
207
|
+
cognee/infrastructure/databases/vector/embeddings/OllamaEmbeddingEngine.py,sha256=QGU9BpzlTJyWESvjUiFOuAOjkj2LCJTq9FOizPzIi00,5084
|
|
208
208
|
cognee/infrastructure/databases/vector/embeddings/__init__.py,sha256=Akv-ShdXjHw-BE00Gw55GgGxIMr0SZ9FHi3RlpsJmiE,55
|
|
209
209
|
cognee/infrastructure/databases/vector/embeddings/config.py,sha256=w7zaQEBNjnYXQi2N5gTCIooDzwGI3HCyyeWt-Q5WIKw,2539
|
|
210
210
|
cognee/infrastructure/databases/vector/embeddings/embedding_rate_limiter.py,sha256=TyCoo_SipQ6JNy5eqXY2shrZnhb2JVjt9xOsJltOCdw,17598
|
|
@@ -849,9 +849,9 @@ cognee/tests/integration/documents/PdfDocument_test.py,sha256=IY0Cck8J2gEyuJHPK0
|
|
|
849
849
|
cognee/tests/integration/documents/TextDocument_test.py,sha256=aSYfyvSQLceZ1c5NqV5Jf5eGA3BL_adP6iwWnT9eMCg,2159
|
|
850
850
|
cognee/tests/integration/documents/UnstructuredDocument_test.py,sha256=nZktosptjw85V1_2iAwlOaYghA4cmqEX62RvQSgU_NY,4006
|
|
851
851
|
cognee/tests/integration/documents/async_gen_zip.py,sha256=h98Q6cxhwb49iaYm4NZ-GmbNDAux-BKplofNgf4aIpc,317
|
|
852
|
-
cognee/tests/integration/web_url_crawler/test_default_url_crawler.py,sha256=
|
|
853
|
-
cognee/tests/integration/web_url_crawler/test_tavily_crawler.py,sha256=
|
|
854
|
-
cognee/tests/integration/web_url_crawler/test_url_adding_e2e.py,sha256=
|
|
852
|
+
cognee/tests/integration/web_url_crawler/test_default_url_crawler.py,sha256=Qk__D7-SwpE5YfCiXoIDF3LgablRMhtoSSGfCVYY-PM,349
|
|
853
|
+
cognee/tests/integration/web_url_crawler/test_tavily_crawler.py,sha256=tro2Isg-zqEEkD03oCWzYV8n5KlqGaUP69RcVVaeYDc,493
|
|
854
|
+
cognee/tests/integration/web_url_crawler/test_url_adding_e2e.py,sha256=F1eTCI9Q9kVwOh5DuDf-uVxz3DqZvJj2HGlAiREIX_8,11127
|
|
855
855
|
cognee/tests/subprocesses/reader.py,sha256=NW5zbXhWUcFXyN9RRAW2lzxCvEYV8hno6gBmE18O0b8,954
|
|
856
856
|
cognee/tests/subprocesses/simple_cognify_1.py,sha256=WE2hG50rFwceKNL07PeAYu-Mrs74pjmdPEQrqZiTf8s,869
|
|
857
857
|
cognee/tests/subprocesses/simple_cognify_2.py,sha256=nv0gJZCLn0iwY7SumiGlIiGJc1tFCyiHhAUzw0sjLn8,872
|
|
@@ -942,9 +942,9 @@ distributed/tasks/queued_add_edges.py,sha256=kz1DHE05y-kNHORQJjYWHUi6Q1QWUp_v3Dl
|
|
|
942
942
|
distributed/tasks/queued_add_nodes.py,sha256=aqK4Ij--ADwUWknxYpiwbYrpa6CcvFfqHWbUZW4Kh3A,452
|
|
943
943
|
distributed/workers/data_point_saving_worker.py,sha256=kmaQy2A2J7W3k9Gd5lyoiT0XYOaJmEM8MbkKVOFOQVU,4729
|
|
944
944
|
distributed/workers/graph_saving_worker.py,sha256=b5OPLLUq0OBALGekdp73JKxU0GrMlVbO4AfIhmACKkQ,4724
|
|
945
|
-
cognee-0.4.
|
|
946
|
-
cognee-0.4.
|
|
947
|
-
cognee-0.4.
|
|
948
|
-
cognee-0.4.
|
|
949
|
-
cognee-0.4.
|
|
950
|
-
cognee-0.4.
|
|
945
|
+
cognee-0.4.1.dist-info/METADATA,sha256=Xv_KcVeblOMxrXCaUpcHGbOnEXhwRHiVtidZw1cJHss,15358
|
|
946
|
+
cognee-0.4.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
947
|
+
cognee-0.4.1.dist-info/entry_points.txt,sha256=fAozOD9Vs4kgYwRhBiZoLCIXu-OSZqVxKGv45l19uok,88
|
|
948
|
+
cognee-0.4.1.dist-info/licenses/LICENSE,sha256=pHHjSQj1DD8SDppW88MMs04TPk7eAanL1c5xj8NY7NQ,11344
|
|
949
|
+
cognee-0.4.1.dist-info/licenses/NOTICE.md,sha256=6L3saP3kSpcingOxDh-SGjMS8GY79Rlh2dBNLaO0o5c,339
|
|
950
|
+
cognee-0.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|