From 69e460edd36f3bd6b8211f6166d576ad810c25fd Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Mon, 22 Jan 2024 12:26:08 +0330 Subject: [PATCH 1/4] feat: added LLM traces feature! --- dags/hivemind_etl.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dags/hivemind_etl.py b/dags/hivemind_etl.py index 46e39560..4dd82bc2 100644 --- a/dags/hivemind_etl.py +++ b/dags/hivemind_etl.py @@ -32,6 +32,7 @@ from hivemind_etl_helpers.src.utils.get_mongo_discord_communities import ( get_all_discord_communities, ) +from traceloop.sdk import Traceloop # def setup_phonix(): # _ = px.launch_app() @@ -54,6 +55,7 @@ def get_discord_communities() -> list[str]: """ Getting all communities having discord from database """ + setup_traceloop() communities = get_all_discord_communities() return communities @@ -82,6 +84,7 @@ def get_mongo_discord_communities() -> list[str]: this function is the same with `get_discord_communities` we just changed the name for the pylint """ + setup_traceloop() communities = get_all_discord_communities() return communities @@ -94,3 +97,7 @@ def start_discord_summary_vectorstore(community_id: str): communities = get_mongo_discord_communities() start_discord_summary_vectorstore.expand(community_id=communities) + + +def setup_traceloop(): + Traceloop.init() \ No newline at end of file From 4ac9c5aa96bf8ee38b00b73ec111070d05854a37 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Mon, 22 Jan 2024 12:27:29 +0330 Subject: [PATCH 2/4] feat: Updated the docker-compose! --- docker-compose.test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 9a61b959..0b73a2a9 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -26,6 +26,7 @@ services: - EMBEDDING_DIM=1024 - OPENAI_API_KEY=some_credentials - COHERE_API_KEY=some_credentials + - TRACELOOP_BASE_URL=some_url volumes: - ./coverage:/project/coverage depends_on: From 68601ed74b7d9aae0d1c17657e2d01d40be76910 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Mon, 22 Jan 2024 12:35:33 +0330 Subject: [PATCH 3/4] fix: black linter issue! --- dags/hivemind_etl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dags/hivemind_etl.py b/dags/hivemind_etl.py index 4dd82bc2..ac8a1ca1 100644 --- a/dags/hivemind_etl.py +++ b/dags/hivemind_etl.py @@ -100,4 +100,4 @@ def start_discord_summary_vectorstore(community_id: str): def setup_traceloop(): - Traceloop.init() \ No newline at end of file + Traceloop.init() From 914e08400eaaf1d73ea98d6974504faf75120ec4 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Mon, 22 Jan 2024 12:44:42 +0330 Subject: [PATCH 4/4] update: requirements.txt - Added traceloop sdk! --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 0ab85c42..a14ed6c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,3 +17,4 @@ coverage>=7.3.3, <8.0.0 pytest>=7.4.3, <8.0.0 python-dotenv>=1.0.0, <2.0.0 tc-hivemind-backend==1.1.1 +traceloop-sdk