You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(api): Implement datasource and LLM management endpoints
- Added new endpoints for managing datasources including adding, listing, retrieving, and removing datasources.
- Introduced LLM management endpoints for configuring, listing, and retrieving LLM details.
- Enhanced health and readiness checks with service integration.
- Refactored query execution to utilize the new service architecture.
- Updated API documentation to reflect the new two-tier architecture and added endpoint descriptions.
- Introduced new service classes for datasource, LLM, health, and indexing management.
- Removed deprecated schema endpoints and integrated schema retrieval into the new structure.
This guide walks through the minimal steps to run the NL2SQL pipeline from Python code. The runtime is configured via environment variables and the YAML/JSON files under `configs/`.
3
+
This guide walks through the minimal steps to run the NL2SQL pipeline. NL2SQL provides a **two-tier API architecture** for flexible integration:
4
+
5
+
1.**Core API (Python)**: Direct Python integration using the `NL2SQL` class
6
+
2.**REST API (HTTP)**: HTTP endpoints for remote access and web applications
7
+
8
+
Choose the option that best fits your use case.
4
9
5
10
## Prerequisites
6
11
7
-
- Python 3.10+
12
+
- Python 3.10+ (for Python integration)
13
+
- Docker (for API container deployment, optional)
8
14
- A configured datasource in `configs/datasources.yaml`
9
15
- An LLM configuration in `configs/llm.yaml`
10
16
11
-
## Install the core package
17
+
## Installation Options
18
+
19
+
### Option 1: Install Core Package from PyPI
20
+
21
+
```bash
22
+
pip install nl2sql-core
23
+
```
24
+
25
+
### Option 2: Install from Local Source (Development)
12
26
13
27
```bash
14
28
pip install -e packages/core
@@ -21,7 +35,13 @@ If you are using the SQLAlchemy adapter, install it as well:
21
35
pip install -e packages/adapter-sqlalchemy
22
36
```
23
37
24
-
## Configure the system
38
+
### Option 3: Install API Package
39
+
40
+
```bash
41
+
pip install -e packages/api
42
+
```
43
+
44
+
## Configuration
25
45
26
46
`NL2SQLContext` reads its configuration from these settings (see `nl2sql.common.settings.Settings`):
Both APIs accept an `execute` flag that determines whether to execute the generated SQL against the database:
64
270
65
-
`run_with_graph()` accepts an `execute` flag and passes it to `build_graph()`. The current graph builder does not branch on this flag, so any execution gating must be implemented inside nodes or executors.
271
+
-`execute=True` (default): Execute the SQL and return results
272
+
-`execute=False`: Return the generated SQL without execution
66
273
67
-
## Next steps
274
+
## Next Steps
68
275
69
276
- See `configuration/system.md` for configuration details and environment variable mapping.
70
277
- See `deployment/architecture.md` for production deployment guidance.
278
+
- See `api/index.md` for detailed API documentation.
279
+
- See `packages/core/PUBLIC_API_DOCS.md` for Core API reference.
280
+
- See `packages/api/API_DOCS.md` for REST API reference.
0 commit comments