Skip to content

Commit

Permalink
seed data on env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jan 5, 2025
1 parent 8eaee21 commit 77a1847
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions agixt/DB.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,11 +744,12 @@ def setup_default_roles():
# Create any missing tables
Base.metadata.create_all(engine)
setup_default_roles()
seed_data = str(getenv("SEED_DATA")).lower() == "true"
if seed_data:
# Import seed data
from SeedImports import import_all_data

# Import seed data
from SeedImports import import_all_data

import_all_data()
import_all_data()
uvicorn.run(
"app:app",
host="0.0.0.0",
Expand Down
1 change: 1 addition & 0 deletions agixt/Globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def getenv(var_name: str, default_value: str = "") -> str:
"REGISTRATION_DISABLED": "false",
"CREATE_AGENT_ON_REGISTER": "true",
"CREATE_AGIXT_AGENT": "true",
"SEED_DATA": "true",
}
if default_value != "":
default_values[var_name] = default_value
Expand Down

0 comments on commit 77a1847

Please sign in to comment.