nao-core 0.0.25__py3-none-any.whl → 0.0.27__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-chat-server +0 -0
- nao_core/commands/chat.py +7 -0
- nao_core/commands/init.py +34 -1
- nao_core/config/__init__.py +2 -0
- nao_core/config/base.py +2 -0
- nao_core/config/slack/__init__.py +12 -0
- {nao_core-0.0.25.dist-info → nao_core-0.0.27.dist-info}/METADATA +1 -1
- {nao_core-0.0.25.dist-info → nao_core-0.0.27.dist-info}/RECORD +12 -11
- {nao_core-0.0.25.dist-info → nao_core-0.0.27.dist-info}/WHEEL +0 -0
- {nao_core-0.0.25.dist-info → nao_core-0.0.27.dist-info}/entry_points.txt +0 -0
- {nao_core-0.0.25.dist-info → nao_core-0.0.27.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.27"
|
nao_core/bin/nao-chat-server
CHANGED
|
Binary file
|
nao_core/commands/chat.py
CHANGED
|
@@ -150,6 +150,13 @@ def chat():
|
|
|
150
150
|
env[env_var_name] = config.llm.api_key
|
|
151
151
|
console.print(f"[bold green]✓[/bold green] Set {env_var_name} from config")
|
|
152
152
|
|
|
153
|
+
# Set Slack config if available
|
|
154
|
+
if config and config.slack:
|
|
155
|
+
env["SLACK_BOT_TOKEN"] = config.slack.bot_token
|
|
156
|
+
env["SLACK_SIGNING_SECRET"] = config.slack.signing_secret
|
|
157
|
+
env["SLACK_POST_MESSAGE_URL"] = config.slack.post_message_url
|
|
158
|
+
console.print("[bold green]✓[/bold green] Set Slack environment variables from config")
|
|
159
|
+
|
|
153
160
|
env["NAO_PROJECT_FOLDER"] = str(Path.cwd())
|
|
154
161
|
env["FASTAPI_URL"] = f"http://localhost:{FASTAPI_PORT}"
|
|
155
162
|
|
nao_core/commands/init.py
CHANGED
|
@@ -7,7 +7,7 @@ from rich.console import Console
|
|
|
7
7
|
from rich.panel import Panel
|
|
8
8
|
from rich.prompt import Confirm, Prompt
|
|
9
9
|
|
|
10
|
-
from nao_core.config import AnyDatabaseConfig, BigQueryConfig, DatabaseType, LLMConfig, LLMProvider, NaoConfig
|
|
10
|
+
from nao_core.config import AnyDatabaseConfig, BigQueryConfig, DatabaseType, LLMConfig, LLMProvider, NaoConfig, SlackConfig
|
|
11
11
|
from nao_core.config.repos import RepoConfig
|
|
12
12
|
|
|
13
13
|
console = Console()
|
|
@@ -185,6 +185,38 @@ def setup_llm() -> LLMConfig | None:
|
|
|
185
185
|
return llm_config
|
|
186
186
|
|
|
187
187
|
|
|
188
|
+
def setup_slack() -> SlackConfig | None:
|
|
189
|
+
"""Setup the Slack configuration."""
|
|
190
|
+
slack_config = None
|
|
191
|
+
should_setup = Confirm.ask("\n[bold]Set up Slack integration?[/bold]", default=False)
|
|
192
|
+
|
|
193
|
+
if should_setup:
|
|
194
|
+
console.print("\n[bold cyan]Slack Configuration[/bold cyan]\n")
|
|
195
|
+
|
|
196
|
+
bot_token = Prompt.ask(
|
|
197
|
+
"[bold]Enter your Slack bot token[/bold]",
|
|
198
|
+
password=True,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
if not bot_token:
|
|
202
|
+
raise InitError("Slack bot token cannot be empty.")
|
|
203
|
+
|
|
204
|
+
signing_secret = Prompt.ask(
|
|
205
|
+
"[bold]Enter your Slack signing secret[/bold]",
|
|
206
|
+
password=True,
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
if not signing_secret:
|
|
210
|
+
raise InitError("Slack signing secret cannot be empty.")
|
|
211
|
+
|
|
212
|
+
slack_config = SlackConfig(
|
|
213
|
+
bot_token=bot_token,
|
|
214
|
+
signing_secret=signing_secret,
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
return slack_config
|
|
218
|
+
|
|
219
|
+
|
|
188
220
|
def create_empty_structure(project_path: Path) -> tuple[list[str], list[str]]:
|
|
189
221
|
"""Create project folder structure to guide users.
|
|
190
222
|
|
|
@@ -240,6 +272,7 @@ def init(
|
|
|
240
272
|
databases=setup_databases(),
|
|
241
273
|
repos=setup_repos(),
|
|
242
274
|
llm=setup_llm(),
|
|
275
|
+
slack=setup_slack(),
|
|
243
276
|
)
|
|
244
277
|
config.save(project_path)
|
|
245
278
|
|
nao_core/config/__init__.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .base import NaoConfig
|
|
2
2
|
from .databases import AccessorType, AnyDatabaseConfig, BigQueryConfig, DatabaseType
|
|
3
3
|
from .llm import LLMConfig, LLMProvider
|
|
4
|
+
from .slack import SlackConfig
|
|
4
5
|
|
|
5
6
|
__all__ = [
|
|
6
7
|
"NaoConfig",
|
|
@@ -10,4 +11,5 @@ __all__ = [
|
|
|
10
11
|
"DatabaseType",
|
|
11
12
|
"LLMConfig",
|
|
12
13
|
"LLMProvider",
|
|
14
|
+
"SlackConfig",
|
|
13
15
|
]
|
nao_core/config/base.py
CHANGED
|
@@ -7,6 +7,7 @@ from pydantic import BaseModel, Field, model_validator
|
|
|
7
7
|
from .databases import AnyDatabaseConfig, parse_database_config
|
|
8
8
|
from .llm import LLMConfig
|
|
9
9
|
from .repos import RepoConfig
|
|
10
|
+
from .slack import SlackConfig
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class NaoConfig(BaseModel):
|
|
@@ -16,6 +17,7 @@ class NaoConfig(BaseModel):
|
|
|
16
17
|
databases: list[AnyDatabaseConfig] = Field(default_factory=list, description="The databases to use")
|
|
17
18
|
repos: list[RepoConfig] = Field(default_factory=list, description="The repositories to use")
|
|
18
19
|
llm: LLMConfig | None = Field(default=None, description="The LLM configuration")
|
|
20
|
+
slack: SlackConfig | None = Field(default=None, description="The Slack configuration")
|
|
19
21
|
|
|
20
22
|
@model_validator(mode="before")
|
|
21
23
|
@classmethod
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class SlackConfig(BaseModel):
|
|
5
|
+
"""Slack configuration."""
|
|
6
|
+
|
|
7
|
+
bot_token: str = Field(description="The bot token to use")
|
|
8
|
+
signing_secret: str = Field(description="The signing secret for verifying requests")
|
|
9
|
+
post_message_url: str = Field(
|
|
10
|
+
default="https://slack.com/api/chat.postMessage",
|
|
11
|
+
description="The Slack API URL for posting messages",
|
|
12
|
+
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
nao_core/__init__.py,sha256=
|
|
1
|
+
nao_core/__init__.py,sha256=tDzsg0jcjNWuN36zFbgHU-jsLQ9VDe6imgA6fw184oo,46
|
|
2
2
|
nao_core/main.py,sha256=f00vLL4s2B2kCMa8y3lI56LX3TnUppWzYmqM6eOGomA,205
|
|
3
3
|
nao_core/bin/.nao-secret,sha256=BeHkxTsBb9ehjUkjZrY2SMU6SB0cfbcjBwpeGxsUJJk,43
|
|
4
|
-
nao_core/bin/nao-chat-server,sha256=
|
|
4
|
+
nao_core/bin/nao-chat-server,sha256=LiT0qC8Fxj9ySjnztxBELFs2VWZ4kqktBRP_RyOcBnc,66110448
|
|
5
5
|
nao_core/bin/rg,sha256=bvQDRr8x_M552WFMd0XBmFQpJaDH1JEeH_55TFM5KsE,4528512
|
|
6
6
|
nao_core/bin/fastapi/main.py,sha256=PbbLCdNFKzVUaygxeKiWFBY-NCMsP_w6UUT3zn4Wmo4,3622
|
|
7
7
|
nao_core/bin/migrations-postgres/0000_user_auth_and_chat_tables.sql,sha256=UEOxvNaQEKPeZimW-HgHmeCg_py2ToDZkxFXk2NoNSo,4601
|
|
@@ -45,24 +45,25 @@ nao_core/bin/public/assets/signup-D2n11La3.js,sha256=pXBGPAZPHjtGk_4FdzYYx6-u-26
|
|
|
45
45
|
nao_core/bin/public/assets/user-CYl8Tly2.js,sha256=D7ENz2WQH738ykeOqY5jIRSQdUyjsCKENQ4sAOQXnms,2401
|
|
46
46
|
nao_core/bin/public/assets/utils-DzJYey0s.js,sha256=-xZkeUik--c4EokvT2GIYT9hZZQ6ah86T6lhcP1QfCI,25772
|
|
47
47
|
nao_core/commands/__init__.py,sha256=rFCuUyA9wM4hS6CxCt2M_5W4VysyQXh6HkA_hyRCxPc,207
|
|
48
|
-
nao_core/commands/chat.py,sha256=
|
|
48
|
+
nao_core/commands/chat.py,sha256=XGpJepj3iciCmNzQ6abVVDNKv2ovB2lPwQTboNlPbWU,7982
|
|
49
49
|
nao_core/commands/debug.py,sha256=Hdtb6_2F-a9Nr-aU_exdnPZY0-Lf9dgV1QX6QxPr9P8,4794
|
|
50
|
-
nao_core/commands/init.py,sha256=
|
|
50
|
+
nao_core/commands/init.py,sha256=6xHCeM_6sI4j3uBfb2LEXB2eZzq1kiUH2gAC-A_gdTI,9902
|
|
51
51
|
nao_core/commands/sync/__init__.py,sha256=Opg4j0xvNdSBtHXZ6FzCihW05c6UDONxKgkIACJ1pAE,1853
|
|
52
52
|
nao_core/commands/sync/accessors.py,sha256=3QrOA5-tsBy6A3OETvc9CJaeCG5hBrLm6k8my984hsE,6932
|
|
53
53
|
nao_core/commands/sync/databases.py,sha256=uLpFOr2YOy7N4b3mkPeigkvZ_V5A6E7L-LPfToTpi0k,4259
|
|
54
54
|
nao_core/commands/sync/registry.py,sha256=0yExoePzNZ_T0AswEr49ztOyHWaruz63ifVSGj1baO8,728
|
|
55
55
|
nao_core/commands/sync/repositories.py,sha256=GNzM5CouCK9zlQPW5B94c4Tye-bpmSWtAdZRXd0No30,3043
|
|
56
|
-
nao_core/config/__init__.py,sha256=
|
|
57
|
-
nao_core/config/base.py,sha256=
|
|
56
|
+
nao_core/config/__init__.py,sha256=eBErJt7nlAtFWsp3ZqveaFwVbDJnPAGwbh-YKXJzuLM,358
|
|
57
|
+
nao_core/config/base.py,sha256=7gPNfiwRbF-5ra4qDTttPSzcV3krXr-_scFMKXFTBgY,2964
|
|
58
58
|
nao_core/config/databases/__init__.py,sha256=t62wpLCTi9lAf6rzem7iu605ywtK4qo7DuTP-qSr3jc,1027
|
|
59
59
|
nao_core/config/databases/base.py,sha256=Y0BN8Zowi0n0GKT2sEJ2iqitPf-P4o1V9gCVhgiSzr8,2219
|
|
60
60
|
nao_core/config/databases/bigquery.py,sha256=RA07YMp24kQVPOQStdLCx27e50nUIIoO_U1io1wqtVk,1453
|
|
61
61
|
nao_core/config/llm/__init__.py,sha256=TBCL0ZJ83NIu1VoPof0uYkM_sBIboCDR36HnwwtJmiY,371
|
|
62
62
|
nao_core/config/repos/__init__.py,sha256=R3LyHr9JtQG0DQ5Ae7pD5vO-ZrChAth-U-dFPJ0fRQ4,55
|
|
63
63
|
nao_core/config/repos/base.py,sha256=kutfkSzOW2F2zFnD2vy69hjhsazV86-z-Mr2Nn8KBqU,353
|
|
64
|
-
nao_core
|
|
65
|
-
nao_core-0.0.
|
|
66
|
-
nao_core-0.0.
|
|
67
|
-
nao_core-0.0.
|
|
68
|
-
nao_core-0.0.
|
|
64
|
+
nao_core/config/slack/__init__.py,sha256=VLovE8Dp8Sgv_1N-I3XEmlxPOVWk8QxATHp17cMdR-o,415
|
|
65
|
+
nao_core-0.0.27.dist-info/METADATA,sha256=09Je9HTIsxh7mZOfiubgSEUzeAF_SHfCtluSUItsyIs,5206
|
|
66
|
+
nao_core-0.0.27.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
67
|
+
nao_core-0.0.27.dist-info/entry_points.txt,sha256=SZakIiNybgS3pl_OEZVLyLSweadeBFoEMBECMoj9czY,42
|
|
68
|
+
nao_core-0.0.27.dist-info/licenses/LICENSE,sha256=rn5YtWB6E5hPQI49tCTNSyqlArWGsB6HzA5FfSbRHRs,1066
|
|
69
|
+
nao_core-0.0.27.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|