nao-core 0.0.19__py3-none-any.whl → 0.0.22__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 CHANGED
@@ -1,2 +1,2 @@
1
1
  # nao Core CLI package
2
- __version__ = "0.0.19"
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
- # Convert numpy types to native Python types for JSON serialization
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.name}"
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
nao_core/config/base.py CHANGED
@@ -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
- """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nao-core
3
- Version: 0.0.19
3
+ Version: 0.0.22
4
4
  Summary: nao Core is your analytics context builder with the best chat interface.
5
5
  Project-URL: Homepage, https://getnao.io
6
6
  Project-URL: Repository, https://github.com/naolabs/chat
@@ -1,8 +1,8 @@
1
- nao_core/__init__.py,sha256=zPxVQIj4me6gBFTIbSLhpZOVABJzMgJQxIJBBoIGDts,46
1
+ nao_core/__init__.py,sha256=hdybmf5-qJgomilObabCYSSY_vCmHTQxoUog5hK4mLA,46
2
2
  nao_core/main.py,sha256=f00vLL4s2B2kCMa8y3lI56LX3TnUppWzYmqM6eOGomA,205
3
- nao_core/bin/nao-chat-server,sha256=2sbhorVuSngFRlB1hlQ5OPvAxElwT-MOAk1Ec8EoiwQ,64772976
3
+ nao_core/bin/nao-chat-server,sha256=ET0vCn4UjNb9dS8eoEp1Tb_qDi2yC-zrn7mjjG6gViU,64772976
4
4
  nao_core/bin/rg,sha256=bvQDRr8x_M552WFMd0XBmFQpJaDH1JEeH_55TFM5KsE,4528512
5
- nao_core/bin/fastapi/main.py,sha256=Z7q2HWZd4L2NbkpeqmjjxngNN1MyFafvZlF0oz0FoVA,4216
5
+ nao_core/bin/fastapi/main.py,sha256=HwLSVbzXYgQlKLi_UdBVGS5jhw4fLWSwUoKPr26hsBc,3623
6
6
  nao_core/bin/migrations-postgres/0000_user_auth_and_chat_tables.sql,sha256=UEOxvNaQEKPeZimW-HgHmeCg_py2ToDZkxFXk2NoNSo,4601
7
7
  nao_core/bin/migrations-postgres/meta/0000_snapshot.json,sha256=8bV8DQjaks4Id2aPPWbVcSb5xMhPKNf_V0loe01dnl8,17997
8
8
  nao_core/bin/migrations-postgres/meta/_journal.json,sha256=BdeQ6ckHOwLSdkBP8vSl-stx3QQvJuqyFGtBCkdK2sI,219
@@ -32,19 +32,19 @@ nao_core/commands/debug.py,sha256=Hdtb6_2F-a9Nr-aU_exdnPZY0-Lf9dgV1QX6QxPr9P8,47
32
32
  nao_core/commands/init.py,sha256=ZPD5jGCmkMbHvYX2sA-88jBPVL2LqJwdk3VfBuf1scU,8964
33
33
  nao_core/commands/sync/__init__.py,sha256=Opg4j0xvNdSBtHXZ6FzCihW05c6UDONxKgkIACJ1pAE,1853
34
34
  nao_core/commands/sync/accessors.py,sha256=3QrOA5-tsBy6A3OETvc9CJaeCG5hBrLm6k8my984hsE,6932
35
- nao_core/commands/sync/databases.py,sha256=5RPuKuQ-ZLSLclIqsX_u7tQwieqaag4UXfFJP5FEX3I,4248
35
+ nao_core/commands/sync/databases.py,sha256=uLpFOr2YOy7N4b3mkPeigkvZ_V5A6E7L-LPfToTpi0k,4259
36
36
  nao_core/commands/sync/registry.py,sha256=0yExoePzNZ_T0AswEr49ztOyHWaruz63ifVSGj1baO8,728
37
37
  nao_core/commands/sync/repositories.py,sha256=GNzM5CouCK9zlQPW5B94c4Tye-bpmSWtAdZRXd0No30,3043
38
38
  nao_core/config/__init__.py,sha256=qzM2sXRKfO5ZCKbIRwUS-Roh5ry0zVEqWJBobVlGbJM,308
39
- nao_core/config/base.py,sha256=iekOHhsKbZfU4Gz3uaKhFF-Bndfr9MFPrZEHImqXAzo,3085
39
+ nao_core/config/base.py,sha256=jS5leDqjc6wzU1iHw4rTun75s8hdv0N3Kjjb6kljQ8E,2842
40
40
  nao_core/config/databases/__init__.py,sha256=t62wpLCTi9lAf6rzem7iu605ywtK4qo7DuTP-qSr3jc,1027
41
41
  nao_core/config/databases/base.py,sha256=Y0BN8Zowi0n0GKT2sEJ2iqitPf-P4o1V9gCVhgiSzr8,2219
42
42
  nao_core/config/databases/bigquery.py,sha256=RA07YMp24kQVPOQStdLCx27e50nUIIoO_U1io1wqtVk,1453
43
43
  nao_core/config/llm/__init__.py,sha256=wBVFFmOWWUuIM19fNeXkdIWxg9nE_cR3roWFyUvAuIE,343
44
44
  nao_core/config/repos/__init__.py,sha256=R3LyHr9JtQG0DQ5Ae7pD5vO-ZrChAth-U-dFPJ0fRQ4,55
45
45
  nao_core/config/repos/base.py,sha256=kutfkSzOW2F2zFnD2vy69hjhsazV86-z-Mr2Nn8KBqU,353
46
- nao_core-0.0.19.dist-info/METADATA,sha256=o5ZsyBuxBBJ2RHppg7NKgU-Ef1Y1l_xswvwIxn8t2GM,5206
47
- nao_core-0.0.19.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
48
- nao_core-0.0.19.dist-info/entry_points.txt,sha256=SZakIiNybgS3pl_OEZVLyLSweadeBFoEMBECMoj9czY,42
49
- nao_core-0.0.19.dist-info/licenses/LICENSE,sha256=rn5YtWB6E5hPQI49tCTNSyqlArWGsB6HzA5FfSbRHRs,1066
50
- nao_core-0.0.19.dist-info/RECORD,,
46
+ nao_core-0.0.22.dist-info/METADATA,sha256=SLk_yVWR-4YNC1unO9rTX1Qq-KBSc2JlqGOovejRPTw,5206
47
+ nao_core-0.0.22.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
48
+ nao_core-0.0.22.dist-info/entry_points.txt,sha256=SZakIiNybgS3pl_OEZVLyLSweadeBFoEMBECMoj9czY,42
49
+ nao_core-0.0.22.dist-info/licenses/LICENSE,sha256=rn5YtWB6E5hPQI49tCTNSyqlArWGsB6HzA5FfSbRHRs,1066
50
+ nao_core-0.0.22.dist-info/RECORD,,