Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
AI Tutor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Salma Mohammed Hamed
AI Tutor
Commits
8d03aea2
Commit
8d03aea2
authored
Nov 23, 2025
by
salma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move reset any part of the db option to the env vars for better control
parent
754e2486
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
13 deletions
+27
-13
apply_test_schema.py
self_hosted_env/voice_agent/apply_test_schema.py
+7
-5
curriculum_structure.py
self_hosted_env/voice_agent/curriculum_structure.py
+8
-2
insert_csv_embeddings.py
self_hosted_env/voice_agent/insert_csv_embeddings.py
+6
-5
setup_mcq_table.py
self_hosted_env/voice_agent/setup_mcq_table.py
+6
-1
No files found.
self_hosted_env/voice_agent/apply_test_schema.py
View file @
8d03aea2
import
psycopg2
import
os
import
sys
schema_sql
=
"""
-- Create students table
...
...
@@ -113,8 +114,9 @@ def setup_database(drop_existing_tables: bool = False):
if
__name__
==
"__main__"
:
# To run with a clean slate, pass True
#setup_database(drop_existing_tables=True)
# To run without dropping tables (default)
setup_database
()
\ No newline at end of file
_drop_env
=
os
.
getenv
(
"DROP_TEST_SCHEMA"
,
"False"
)
drop_existing_tables
=
str
(
_drop_env
)
.
strip
()
.
lower
()
in
(
"1"
,
"true"
,
"yes"
,
"y"
,
"t"
)
print
(
"**************************************************"
)
print
(
f
"Drop existing tables: {drop_existing_tables}"
)
print
(
"**************************************************"
)
setup_database
(
drop_existing_tables
=
drop_existing_tables
)
\ No newline at end of file
self_hosted_env/voice_agent/curriculum_structure.py
View file @
8d03aea2
...
...
@@ -260,9 +260,15 @@ if __name__ == "__main__":
# Path to the JSON file
json_file_path
=
"All_Curriculums_grouped.json"
# Read DROP_CURRICULUM_STRUCTURE from env and set drop_existing_table accordingly
_drop_val
=
os
.
getenv
(
"DROP_CURRICULUM_STRUCTURE"
,
""
)
.
strip
()
.
lower
()
drop_existing_table
=
_drop_val
in
(
"1"
,
"true"
,
"yes"
,
"y"
)
print
(
"**************************************************"
)
print
(
f
"Drop existing table: {drop_existing_table}"
)
print
(
"**************************************************"
)
# Setup curriculum database with JSON data
setup_curriculum_database
(
json_file_path
,
drop_existing_table
=
Fals
e
)
setup_curriculum_database
(
json_file_path
,
drop_existing_table
=
drop_existing_tabl
e
)
print
(
"
\n
"
+
"="
*
60
)
print
(
"🔍 Verifying Setup"
)
...
...
self_hosted_env/voice_agent/insert_csv_embeddings.py
View file @
8d03aea2
...
...
@@ -197,8 +197,9 @@ def setup_embeddings_database(drop_existing_tables: bool = False):
print
(
"Database connection closed."
)
if
__name__
==
"__main__"
:
# To run with a clean slate, pass True
# setup_embeddings_database(drop_existing_tables=True)
# To run without dropping the table (default)
setup_embeddings_database
()
\ No newline at end of file
drop_env
=
os
.
getenv
(
"DROP_TABLE_EMBEDDINGS"
,
"false"
)
drop_existing
=
str
(
drop_env
)
.
strip
()
.
lower
()
in
(
"1"
,
"true"
,
"yes"
)
print
(
"**************************************************"
)
print
(
f
"Drop existing table: {drop_existing}"
)
print
(
"**************************************************"
)
setup_embeddings_database
(
drop_existing_tables
=
drop_existing
)
self_hosted_env/voice_agent/setup_mcq_table.py
View file @
8d03aea2
...
...
@@ -74,4 +74,9 @@ def setup_mcq_table(drop_existing_table: bool = False):
if
__name__
==
"__main__"
:
print
(
"Setting up the MCQ table structure..."
)
setup_mcq_table
(
drop_existing_table
=
False
)
\ No newline at end of file
drop_env
=
os
.
getenv
(
"DROP_MCQ_TABLE"
,
"false"
)
drop_existing_table
=
str
(
drop_env
)
.
strip
()
.
lower
()
in
(
"1"
,
"true"
,
"yes"
)
print
(
"**************************************************"
)
print
(
f
"Drop existing table: {drop_existing_table}"
)
print
(
"**************************************************"
)
setup_mcq_table
(
drop_existing_table
=
drop_existing_table
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment