-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_inspect_embedchain_db.py
46 lines (35 loc) · 1.07 KB
/
test_inspect_embedchain_db.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from lib import EmbedApp
# from embedchain.app import DataSource
# import json
# print("[*] DB count:", app.app.db.count())
# serialized_db = app.app.db.serialize()
# print("[*] Serialized DB:")
# print(serialized_db) # just connection configs.
# data_sources = app.app.get_data_sources()
# print("[*] Data sources:")
# print(data_sources)
# all_data = app.app.db_session.query(DataSource).all()
# print("[*] All data:")
# for it in all_data:
# data = dict(
# id=it.id,
# app_id=it.app_id,
# hash=it.hash,
# type=it.type,
# value=it.value,
# meta_data=it.meta_data,
# is_uploaded=it.is_uploaded,
# )
# print(data)
# embed_data = app.app.db.get()
# print(json.dumps(embed_data, indent=4, ensure_ascii=True))
# breakpoint()
# for metadata, document in zip(embed_data['metadatas'], embed_data['documents']):
# url = metadata['url']
def test():
app = EmbedApp()
print("[*] Chroma Embeddings:")
embed_data = app.get_all_data_from_chromadb()
print(embed_data)
if __name__ == "__main__":
test()