Skip to content

Commit cbc1aa4

Browse files
author
ajosh0504
committed
Updating progress tracker, adding to notebooks
1 parent 45d49c8 commit cbc1aa4

File tree

5 files changed

+52
-9
lines changed

5 files changed

+52
-9
lines changed

notebooks/ai-agents-lab.ipynb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
"metadata": {},
165165
"outputs": [],
166166
"source": [
167-
"from utils import create_index, check_index_ready"
167+
"from utils import create_index, check_index_ready, track_progress"
168168
]
169169
},
170170
{
@@ -220,6 +220,16 @@
220220
"check_index_ready(vs_collection, VS_INDEX_NAME)"
221221
]
222222
},
223+
{
224+
"cell_type": "code",
225+
"execution_count": null,
226+
"metadata": {},
227+
"outputs": [],
228+
"source": [
229+
"# Track progress of key steps-- DO NOT CHANGE\n",
230+
"track_progress(\"vs_index_creation\", DB_NAME)"
231+
]
232+
},
223233
{
224234
"cell_type": "markdown",
225235
"metadata": {

notebooks/ai-rag-lab.ipynb

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@
379379
"metadata": {},
380380
"outputs": [],
381381
"source": [
382-
"from utils import create_index, check_index_ready"
382+
"from utils import create_index, check_index_ready, track_progress"
383383
]
384384
},
385385
{
@@ -435,6 +435,16 @@
435435
"check_index_ready(collection, ATLAS_VECTOR_SEARCH_INDEX_NAME)"
436436
]
437437
},
438+
{
439+
"cell_type": "code",
440+
"execution_count": null,
441+
"metadata": {},
442+
"outputs": [],
443+
"source": [
444+
"# Track progress of key steps-- DO NOT CHANGE\n",
445+
"track_progress(\"vs_index_creation\", DB_NAME)"
446+
]
447+
},
438448
{
439449
"cell_type": "markdown",
440450
"metadata": {},
@@ -1054,8 +1064,14 @@
10541064
}
10551065
],
10561066
"metadata": {
1067+
"kernelspec": {
1068+
"display_name": "Python 3",
1069+
"language": "python",
1070+
"name": "python3"
1071+
},
10571072
"language_info": {
1058-
"name": "python"
1073+
"name": "python",
1074+
"version": "3.12.1"
10591075
},
10601076
"widgets": {
10611077
"application/vnd.jupyter.widget-state+json": {

notebooks/utils/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .utils import create_index, check_index_ready
1+
from .utils import create_index, check_index_ready, track_progress
22

3-
__all__ = ["create_index", "check_index_ready"]
3+
__all__ = ["create_index", "check_index_ready", "track_progress"]

notebooks/utils/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,14 @@ def check_index_ready(collection: Collection, index_name: str) -> None:
7373
time.sleep(SLEEP_TIMER)
7474

7575

76-
def track_progress(task: str) -> None:
76+
def track_progress(task: str, workshop_id: str) -> None:
7777
"""
7878
Track progress of a task
7979
8080
Args:
8181
task (str): Task name
82+
workshop (str): Workshop name
8283
"""
8384
print(f"Tracking progress for task {task}")
84-
payload = {"task": task, "id": CODESPACE_NAME}
85+
payload = {"task": task, "workshop_id": workshop_id, "sandbox_id": CODESPACE_NAME}
8586
requests.post(url=SERVERLESS_URL, json={"task": "track_progress", "data": payload})

notebooks/vector-search-lab.ipynb

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@
306306
"metadata": {},
307307
"outputs": [],
308308
"source": [
309-
"from utils import create_index, check_index_ready"
309+
"from utils import create_index, check_index_ready, track_progress"
310310
]
311311
},
312312
{
@@ -362,6 +362,16 @@
362362
"check_index_ready(collection, ATLAS_VECTOR_SEARCH_INDEX_NAME)"
363363
]
364364
},
365+
{
366+
"cell_type": "code",
367+
"execution_count": null,
368+
"metadata": {},
369+
"outputs": [],
370+
"source": [
371+
"# Track progress of key steps-- DO NOT CHANGE\n",
372+
"track_progress(\"vs_index_creation\", DB_NAME)"
373+
]
374+
},
365375
{
366376
"cell_type": "markdown",
367377
"metadata": {},
@@ -924,8 +934,14 @@
924934
}
925935
],
926936
"metadata": {
937+
"kernelspec": {
938+
"display_name": "Python 3",
939+
"language": "python",
940+
"name": "python3"
941+
},
927942
"language_info": {
928-
"name": "python"
943+
"name": "python",
944+
"version": "3.12.1"
929945
},
930946
"widgets": {
931947
"application/vnd.jupyter.widget-state+json": {

0 commit comments

Comments
 (0)