MCPcopy
hub / github.com/llmware-ai/llmware / __init__

Method __init__

llmware/agents.py:1434–1456  ·  view source on GitHub ↗
(self, db=None, db_name=None, experimental=True)

Source from the content-addressed store, hash-verified

1432 """
1433
1434 def __init__(self, db=None, db_name=None, experimental=True):
1435
1436 self.db = "sqlite"
1437
1438 # check for llmware path & create if not already set up, e.g., "first time use"
1439 if not os.path.exists(LLMWareConfig.get_llmware_path()):
1440 LLMWareConfig.setup_llmware_workspace()
1441 logger.info("SQLTables - Setting up LLMWare Workspace.")
1442
1443 # default config for "db_experimental" = "sqlite_experimental.db"
1444 self.db_name = SQLiteConfig().get_config("db_experimental")
1445
1446 if experimental:
1447 self.db_file = SQLiteConfig().get_uri_string_experimental_db()
1448 logging.info("update: connecting to experimental sqlite db - %s", self.db_file)
1449
1450 else:
1451 self.db_file = SQLiteConfig().get_uri_string()
1452 logging.info("warning: connecting to main sqlite db - %s", self.db_file)
1453
1454 self.conn = sqlite3.connect(self.db_file)
1455
1456 self.tables = []
1457
1458 def get_table_schema(self,table_name):
1459

Callers

nothing calls this directly

Calls 7

SQLiteConfigClass · 0.90
get_llmware_pathMethod · 0.80
get_configMethod · 0.45
get_uri_stringMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected