nao-core 0.0.19__py3-none-any.whl → 0.0.25__py3-none-any.whl
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/__init__.py +1 -1
- nao_core/bin/.nao-secret +1 -0
- nao_core/bin/fastapi/main.py +5 -25
- nao_core/bin/migrations-postgres/0001_message_feedback.sql +9 -0
- nao_core/bin/migrations-postgres/0002_chat_message_stop_reason_and_error_message.sql +2 -0
- nao_core/bin/migrations-postgres/0003_handle_slack_with_thread.sql +2 -0
- nao_core/bin/migrations-postgres/meta/0001_snapshot.json +766 -0
- nao_core/bin/migrations-postgres/meta/0002_snapshot.json +778 -0
- nao_core/bin/migrations-postgres/meta/0003_snapshot.json +799 -0
- nao_core/bin/migrations-postgres/meta/_journal.json +21 -0
- nao_core/bin/migrations-sqlite/0001_message_feedback.sql +8 -0
- nao_core/bin/migrations-sqlite/0002_chat_message_stop_reason_and_error_message.sql +2 -0
- nao_core/bin/migrations-sqlite/0003_handle_slack_with_thread.sql +2 -0
- nao_core/bin/migrations-sqlite/meta/0001_snapshot.json +735 -0
- nao_core/bin/migrations-sqlite/meta/0002_snapshot.json +749 -0
- nao_core/bin/migrations-sqlite/meta/0003_snapshot.json +763 -0
- nao_core/bin/migrations-sqlite/meta/_journal.json +21 -0
- nao_core/bin/nao-chat-server +0 -0
- nao_core/bin/public/assets/_chat-layout-BTlqRUE5.js +1 -0
- nao_core/bin/public/assets/{_chat-layout.index-CWlZ1WSD.js → _chat-layout.index-DOARokp1.js} +1 -1
- nao_core/bin/public/assets/agentProvider-C6dGIy-H.js +1 -0
- nao_core/bin/public/assets/button-By_1dzVx.js +1 -0
- nao_core/bin/public/assets/{code-block-F6WJLWQG-BdtbfwZl.js → code-block-F6WJLWQG-EQr6mTlQ.js} +3 -3
- nao_core/bin/public/assets/folder-DnRS5rg3.js +1 -0
- nao_core/bin/public/assets/index-CElAN2SH.css +1 -0
- nao_core/bin/public/assets/index-ZTHASguQ.js +59 -0
- nao_core/bin/public/assets/input-CUQA5tsi.js +1 -0
- nao_core/bin/public/assets/login-BUQDum3t.js +1 -0
- nao_core/bin/public/assets/{mermaid-FSSLJTFX-_2mzlJwk.js → mermaid-FSSLJTFX-Dc6ZvCPw.js} +120 -75
- nao_core/bin/public/assets/sidebar-bgEk7Xg8.js +1 -0
- nao_core/bin/public/assets/signinForm-CGAhnAkv.js +1 -0
- nao_core/bin/public/assets/signup-D2n11La3.js +1 -0
- nao_core/bin/public/assets/user-CYl8Tly2.js +1 -0
- nao_core/bin/public/index.html +2 -2
- nao_core/bin/public/nao-square-logo.png +0 -0
- nao_core/commands/chat.py +43 -0
- nao_core/commands/sync/databases.py +1 -1
- nao_core/config/base.py +0 -9
- nao_core/config/llm/__init__.py +1 -0
- {nao_core-0.0.19.dist-info → nao_core-0.0.25.dist-info}/METADATA +1 -1
- nao_core-0.0.25.dist-info/RECORD +68 -0
- nao_core/bin/public/assets/_chat-layout-BSDXwLlM.js +0 -1
- nao_core/bin/public/assets/agentProvider-BkGOwLc-.js +0 -1
- nao_core/bin/public/assets/createLucideIcon-CAzRYUZ0.js +0 -1
- nao_core/bin/public/assets/index-DD1IB790.css +0 -1
- nao_core/bin/public/assets/index-gWi3S-SV.js +0 -59
- nao_core/bin/public/assets/login-BEFjZaUF.js +0 -1
- nao_core/bin/public/assets/signinForm-D97br205.js +0 -1
- nao_core/bin/public/assets/signup-CU4v0Hqr.js +0 -1
- nao_core-0.0.19.dist-info/RECORD +0 -50
- {nao_core-0.0.19.dist-info → nao_core-0.0.25.dist-info}/WHEEL +0 -0
- {nao_core-0.0.19.dist-info → nao_core-0.0.25.dist-info}/entry_points.txt +0 -0
- {nao_core-0.0.19.dist-info → nao_core-0.0.25.dist-info}/licenses/LICENSE +0 -0
nao_core/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# nao Core CLI package
|
|
2
|
-
__version__ = "0.0.
|
|
2
|
+
__version__ = "0.0.25"
|
nao_core/bin/.nao-secret
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
E64sVzzbsFL7_c5XUJE5r2F1tcAIRub5Wco-e1rw51E
|
nao_core/bin/fastapi/main.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
from nao_core.config import NaoConfig
|
|
1
2
|
from fastapi import FastAPI, HTTPException
|
|
2
|
-
from fastapi.middleware.cors import CORSMiddleware
|
|
3
3
|
from pydantic import BaseModel
|
|
4
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
4
5
|
import uvicorn
|
|
5
6
|
import os
|
|
6
7
|
import sys
|
|
@@ -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)
|
|
@@ -131,6 +112,5 @@ async def execute_sql(request: ExecuteSQLRequest):
|
|
|
131
112
|
except Exception as e:
|
|
132
113
|
raise HTTPException(status_code=500, detail=str(e))
|
|
133
114
|
|
|
134
|
-
|
|
135
115
|
if __name__ == "__main__":
|
|
136
116
|
uvicorn.run("main:app", host="0.0.0.0", port=port, reload=True)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
CREATE TABLE "message_feedback" (
|
|
2
|
+
"message_id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"vote" text NOT NULL,
|
|
4
|
+
"explanation" text,
|
|
5
|
+
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
6
|
+
"updated_at" timestamp DEFAULT now() NOT NULL
|
|
7
|
+
);
|
|
8
|
+
--> statement-breakpoint
|
|
9
|
+
ALTER TABLE "message_feedback" ADD CONSTRAINT "message_feedback_message_id_chat_message_id_fk" FOREIGN KEY ("message_id") REFERENCES "public"."chat_message"("id") ON DELETE cascade ON UPDATE no action;
|