nlsql-coder 0.0.2__tar.gz → 0.0.4__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.
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/PKG-INFO +1 -1
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/helpers/get_agent.py +1 -0
- nlsql_coder-0.0.4/nlsql_coder/app/cli/arg_parsing.py +28 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/cli/interface.py +16 -2
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/data/create_agent_md.py +3 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder.egg-info/PKG-INFO +1 -1
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/pyproject.toml +1 -1
- nlsql_coder-0.0.2/nlsql_coder/app/cli/arg_parsing.py +0 -7
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/LICENSE +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/README.md +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/helpers/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/helpers/memory_manager.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/helpers/project_details.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/helpers/system_prompt.md +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/model/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/model/agent.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/tools/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/tools/file_tools.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/agent/tools/tool_specs.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/cli/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/cli/tool_calling.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/providers/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/providers/aws/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/providers/aws/provider.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/providers/base.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/providers/config.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/app/providers/gcp/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder/data/__init__.py +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder.egg-info/SOURCES.txt +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder.egg-info/dependency_links.txt +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder.egg-info/entry_points.txt +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder.egg-info/requires.txt +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/nlsql_coder.egg-info/top_level.txt +0 -0
- {nlsql_coder-0.0.2 → nlsql_coder-0.0.4}/setup.cfg +0 -0
|
@@ -8,6 +8,7 @@ from importlib import resources
|
|
|
8
8
|
|
|
9
9
|
provider_config = ProviderConfig()
|
|
10
10
|
agent = None
|
|
11
|
+
llm = None
|
|
11
12
|
prompt_path = resources.files("nlsql_coder.app.agent.helpers") / "system_prompt.md"
|
|
12
13
|
system_prompt = prompt_path.read_text()
|
|
13
14
|
agents_md = Path(args.workspace, "AGENTS.md").resolve()
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
arg_parser = argparse.ArgumentParser()
|
|
4
|
+
|
|
5
|
+
arg_parser.add_argument(
|
|
6
|
+
"command",
|
|
7
|
+
nargs="?",
|
|
8
|
+
default=None
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
arg_parser.add_argument(
|
|
12
|
+
"-w",
|
|
13
|
+
"--workspace",
|
|
14
|
+
default=".",
|
|
15
|
+
help="Path to the target project's workspace."
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
arg_parser.add_argument(
|
|
19
|
+
"-u",
|
|
20
|
+
"--usage",
|
|
21
|
+
action="store_true",
|
|
22
|
+
help="Displayed usage data after each conversation turn."
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
args = arg_parser.parse_args()
|
|
26
|
+
|
|
27
|
+
if args.command == "init":
|
|
28
|
+
args.workspace = "."
|
|
@@ -8,6 +8,7 @@ from rich.live import Live
|
|
|
8
8
|
from rich.align import Align
|
|
9
9
|
from nlsql_coder.data.create_agent_md import create_md
|
|
10
10
|
import time
|
|
11
|
+
import os
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
console = Console()
|
|
@@ -17,13 +18,27 @@ Welcome _ _ _ ____ ___ _
|
|
|
17
18
|
| \ | || | / ___| / _ \| |
|
|
18
19
|
to | \| || | \___ \| | | | |
|
|
19
20
|
| |\ || |___ ___) | |_| | |___
|
|
20
|
-
|_| \_||_____||____/ \__\_\_____|
|
|
21
|
+
|_| \_||_____||____/ \__\_\_____| Coder\n\n[/blue bold]
|
|
21
22
|
"""
|
|
22
23
|
|
|
24
|
+
def get_envs():
|
|
25
|
+
console.print("[bold]To start, we need to set up your environment variables...[/bold]")
|
|
26
|
+
os.environ["MODEL_PROVIDER"] = "aws"
|
|
27
|
+
model_name = console.input("\n[bold blue][Model name]:[/bold blue] ")
|
|
28
|
+
access_key_id = console.input("\n[bold blue][Access Key ID]:[/bold blue] ")
|
|
29
|
+
secret_key = console.input("\n[bold blue][Secret Access Key]:[/bold blue] ")
|
|
30
|
+
region = console.input("\n[bold blue][Region]:[/bold blue] ")
|
|
31
|
+
os.environ["MODEL_NAME"] = model_name
|
|
32
|
+
os.environ["AWS_ACCESS_KEY_ID"] = access_key_id
|
|
33
|
+
os.environ["AWS_SECRET_ACCESS_KEY"] = secret_key
|
|
34
|
+
os.environ["AWS_DEFAULT_REGION"] = region
|
|
23
35
|
|
|
24
36
|
|
|
25
37
|
def main_loop():
|
|
26
38
|
try:
|
|
39
|
+
console.clear()
|
|
40
|
+
console.print(Align.center(welcome_message))
|
|
41
|
+
get_envs()
|
|
27
42
|
usage_data = {}
|
|
28
43
|
console.clear()
|
|
29
44
|
with console.status("[bold]Creating AGENTS.md file...\n[/bold]", spinner="dots"):
|
|
@@ -39,7 +54,6 @@ def main_loop():
|
|
|
39
54
|
time.sleep(2)
|
|
40
55
|
console.clear()
|
|
41
56
|
console.print(Align.center(welcome_message))
|
|
42
|
-
|
|
43
57
|
while True:
|
|
44
58
|
|
|
45
59
|
if args.usage and usage_data:
|
|
@@ -7,6 +7,9 @@ from pathlib import Path
|
|
|
7
7
|
# Get relevant project files for context
|
|
8
8
|
def create_md():
|
|
9
9
|
try:
|
|
10
|
+
if not llm:
|
|
11
|
+
raise EnvironmentError("Environment variables not present or incorrect.")
|
|
12
|
+
return
|
|
10
13
|
root = Path(args.workspace)
|
|
11
14
|
if Path(root, "AGENTS.md").exists():
|
|
12
15
|
return "exists"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import argparse
|
|
2
|
-
|
|
3
|
-
arg_parser = argparse.ArgumentParser()
|
|
4
|
-
arg_parser.add_argument("-w", "--workspace", default=".", help="Path to the targe project's workspace.")
|
|
5
|
-
arg_parser.add_argument("-u", "--usage", action="store_true", help="Displayed usage data after each conversation turn.")
|
|
6
|
-
|
|
7
|
-
args = arg_parser.parse_args()
|
|
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
|