### Install Dependencies Source: https://github.com/xgenerationlab/xiyan-dbdescgen/blob/main/README.md Installs the required Python packages from the requirements.txt file. ```shell pip install -r requirements.txt ``` -------------------------------- ### Generate Database Description and Build M-Schema Source: https://github.com/xgenerationlab/xiyan-dbdescgen/blob/main/README.md Initializes SchemaEngine to generate database descriptions and build an M-Schema. The generated schema is saved to a JSON file and printed as a string. ```python from schema_engine import SchemaEngine db_name = 'your_db_name' comment_mode = 'generation' schema_engine_instance = SchemaEngine(db_engine, llm=dashscope_llm, db_name=db_name, comment_mode=comment_mode) schema_engine_instance.fields_category() schema_engine_instance.table_and_column_desc_generation() mschema = schema_engine_instance.mschema mschema.save(f'./{db_name}.json') mschema_str = mschema.to_mschema() print(mschema_str) ``` -------------------------------- ### Create SQLite Database Connection Source: https://github.com/xgenerationlab/xiyan-dbdescgen/blob/main/README.md Establishes a database connection to a SQLite database using SQLAlchemy. ```python import os from sqlalchemy import create_engine db_path = "path_to_sqlite" abs_path = os.path.abspath(db_path) db_engine = create_engine(f'sqlite:///{abs_path}') ``` -------------------------------- ### Set Llama-Index LLM with DashScope Source: https://github.com/xgenerationlab/xiyan-dbdescgen/blob/main/README.md Configures the Llama-index LLM using the DashScope provider. Ensure you replace 'YOUR API KEY HERE.' with your actual API key. ```python from llama_index.llms.dashscope import DashScope, DashScopeGenerationModels dashscope_llm = DashScope(model_name=DashScopeGenerationModels.QWEN_PLUS, api_key='YOUR API KEY HERE.') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.