nao-core 0.0.19__tar.gz → 0.0.22__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nao_core-0.0.19 → nao_core-0.0.22}/PKG-INFO +1 -1
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/__init__.py +1 -1
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/fastapi/main.py +4 -23
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/nao-chat-server +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/commands/sync/databases.py +1 -1
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/config/base.py +0 -9
- {nao_core-0.0.19 → nao_core-0.0.22}/pyproject.toml +1 -1
- {nao_core-0.0.19 → nao_core-0.0.22}/.gitignore +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/LICENSE +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/README.md +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/migrations-postgres/0000_user_auth_and_chat_tables.sql +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/migrations-postgres/meta/0000_snapshot.json +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/migrations-postgres/meta/_journal.json +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/migrations-sqlite/0000_user_auth_and_chat_tables.sql +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/migrations-sqlite/meta/0000_snapshot.json +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/migrations-sqlite/meta/_journal.json +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/_chat-layout-BSDXwLlM.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/_chat-layout.index-CWlZ1WSD.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/agentProvider-BkGOwLc-.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/code-block-F6WJLWQG-BdtbfwZl.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/createLucideIcon-CAzRYUZ0.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/index-DD1IB790.css +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/index-gWi3S-SV.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/login-BEFjZaUF.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/mermaid-FSSLJTFX-_2mzlJwk.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/signinForm-D97br205.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/signup-CU4v0Hqr.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/utils-DzJYey0s.js +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/favicon.ico +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/github-icon.svg +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/google-icon.svg +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/index.html +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/nao-logo-greyscale.svg +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/rg +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/commands/__init__.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/commands/chat.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/commands/debug.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/commands/init.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/commands/sync/__init__.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/commands/sync/accessors.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/commands/sync/registry.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/commands/sync/repositories.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/config/__init__.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/config/databases/__init__.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/config/databases/base.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/config/databases/bigquery.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/config/llm/__init__.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/config/repos/__init__.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/config/repos/base.py +0 -0
- {nao_core-0.0.19 → nao_core-0.0.22}/nao_core/main.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# nao Core CLI package
|
|
2
|
-
__version__ = "0.0.
|
|
2
|
+
__version__ = "0.0.22"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from nao_core.config import NaoConfig
|
|
1
2
|
from fastapi import FastAPI, HTTPException
|
|
2
3
|
from fastapi.middleware.cors import CORSMiddleware
|
|
3
4
|
from pydantic import BaseModel
|
|
@@ -10,8 +11,6 @@ from pathlib import Path
|
|
|
10
11
|
cli_path = Path(__file__).parent.parent.parent / "cli"
|
|
11
12
|
sys.path.insert(0, str(cli_path))
|
|
12
13
|
|
|
13
|
-
from nao_core.config import NaoConfig
|
|
14
|
-
|
|
15
14
|
port = int(os.environ.get("PORT", 8005))
|
|
16
15
|
|
|
17
16
|
app = FastAPI()
|
|
@@ -35,23 +34,6 @@ class ExecuteSQLResponse(BaseModel):
|
|
|
35
34
|
row_count: int
|
|
36
35
|
columns: list[str]
|
|
37
36
|
|
|
38
|
-
class ContextRequest(BaseModel):
|
|
39
|
-
nao_project_folder: str
|
|
40
|
-
|
|
41
|
-
class ContextResponse(BaseModel):
|
|
42
|
-
context: dict
|
|
43
|
-
|
|
44
|
-
@app.post("/context", response_model=ContextResponse)
|
|
45
|
-
async def get_context(request: ContextRequest):
|
|
46
|
-
try:
|
|
47
|
-
# Load the nao config from the project folder
|
|
48
|
-
project_path = Path(request.nao_project_folder)
|
|
49
|
-
config = NaoConfig.try_load(project_path)
|
|
50
|
-
context = config.get_context()
|
|
51
|
-
return ContextResponse(context=context)
|
|
52
|
-
except Exception as e:
|
|
53
|
-
raise HTTPException(status_code=500, detail=str(e))
|
|
54
|
-
|
|
55
37
|
|
|
56
38
|
@app.post("/execute_sql", response_model=ExecuteSQLResponse)
|
|
57
39
|
async def execute_sql(request: ExecuteSQLRequest):
|
|
@@ -102,11 +84,10 @@ async def execute_sql(request: ExecuteSQLRequest):
|
|
|
102
84
|
)
|
|
103
85
|
|
|
104
86
|
connection = db_config.connect()
|
|
105
|
-
result = connection.sql(request.sql)
|
|
106
|
-
|
|
107
|
-
df = result.to_pandas()
|
|
108
87
|
|
|
109
|
-
|
|
88
|
+
cursor = connection.raw_sql(request.sql) # type: ignore[attr-defined]
|
|
89
|
+
df = cursor.to_dataframe()
|
|
90
|
+
|
|
110
91
|
def convert_value(v):
|
|
111
92
|
if isinstance(v, (np.integer,)):
|
|
112
93
|
return int(v)
|
|
Binary file
|
|
@@ -29,7 +29,7 @@ def sync_bigquery(
|
|
|
29
29
|
Tuple of (datasets_synced, tables_synced)
|
|
30
30
|
"""
|
|
31
31
|
conn = db_config.connect()
|
|
32
|
-
db_path = base_path / "bigquery" / f"database={db_config.
|
|
32
|
+
db_path = base_path / "type=bigquery" / f"database={db_config.project_id}"
|
|
33
33
|
|
|
34
34
|
datasets_synced = 0
|
|
35
35
|
tables_synced = 0
|
|
@@ -74,12 +74,3 @@ class NaoConfig(BaseModel):
|
|
|
74
74
|
def json_schema(cls) -> dict:
|
|
75
75
|
"""Generate JSON schema for the configuration."""
|
|
76
76
|
return cls.model_json_schema()
|
|
77
|
-
|
|
78
|
-
def get_context(self) -> str:
|
|
79
|
-
"""Get the context of the project."""
|
|
80
|
-
return f"""
|
|
81
|
-
Project name: {self.project_name}
|
|
82
|
-
Databases: {self.databases}
|
|
83
|
-
Repos: {self.repos}
|
|
84
|
-
LLM: {self.llm}
|
|
85
|
-
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/migrations-postgres/meta/0000_snapshot.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/_chat-layout.index-CWlZ1WSD.js
RENAMED
|
File without changes
|
|
File without changes
|
{nao_core-0.0.19 → nao_core-0.0.22}/nao_core/bin/public/assets/code-block-F6WJLWQG-BdtbfwZl.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|