contextsql-garvit 0.1.3__tar.gz → 0.1.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.
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/PKG-INFO +1 -1
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/cli.py +6 -5
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/PKG-INFO +1 -1
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/pyproject.toml +1 -1
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/README.md +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/__init__.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/agent.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/autoglossary.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/config.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/db.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/feedback.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/glossary.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/hints.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/introspect.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/learn.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/names.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/phrasing.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/prompt.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql/retrieve.py +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/SOURCES.txt +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/dependency_links.txt +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/entry_points.txt +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/requires.txt +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/top_level.txt +0 -0
- {contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/setup.cfg +0 -0
|
@@ -7,7 +7,7 @@ from .config import CONFIG, KNOW, LOG, load_json, save_json
|
|
|
7
7
|
from .db import make_url, get_engine
|
|
8
8
|
|
|
9
9
|
HF_REPO = "Garvitarunav/contextsql-v4"
|
|
10
|
-
HF_FILE = "contextsql-
|
|
10
|
+
HF_FILE = "contextsql-v5-q4_k_m.gguf"
|
|
11
11
|
|
|
12
12
|
def default_model():
|
|
13
13
|
p = Path("models/contextsql-q4_k_m.gguf")
|
|
@@ -81,7 +81,8 @@ def cmd_ask(a):
|
|
|
81
81
|
from .agent import Agent, LlamaGenerator
|
|
82
82
|
cfg = need(CONFIG, "contextsql connect")
|
|
83
83
|
know = need(KNOW, "contextsql learn")
|
|
84
|
-
|
|
84
|
+
m = cfg.get("model") or ""
|
|
85
|
+
if not m or not Path(m).exists() or ("contextsql-v" in m and not m.endswith(HF_FILE)):
|
|
85
86
|
cfg["model"] = default_model()
|
|
86
87
|
save_json(CONFIG, cfg)
|
|
87
88
|
print("Loading model ...")
|
|
@@ -89,17 +90,17 @@ def cmd_ask(a):
|
|
|
89
90
|
q = " ".join(a.question).strip()
|
|
90
91
|
if q:
|
|
91
92
|
show(agent.ask(q)); return
|
|
92
|
-
print("Ask anything about your data (empty line to quit).")
|
|
93
|
+
print("Ask anything about your data (empty line to quit). Commands: /good /fix SQL /status /glossary list cls")
|
|
93
94
|
while True:
|
|
94
95
|
q = input("\n> ").strip()
|
|
95
96
|
if not q: break
|
|
96
97
|
if q.lower() in ("cls", "clear", "/cls", "/clear"):
|
|
97
98
|
os.system("cls" if os.name == "nt" else "clear"); continue
|
|
98
99
|
if q.startswith("/") or q.startswith("contextsql "):
|
|
99
|
-
try:
|
|
100
|
+
try:
|
|
100
101
|
cmd = q[1:] if q.startswith("/") else q[11:]
|
|
101
102
|
main(["fix", cmd[4:].strip()] if cmd.startswith("fix ") else shlex.split(cmd))
|
|
102
|
-
except SystemExit as e:
|
|
103
|
+
except SystemExit as e:
|
|
103
104
|
print(e.code if isinstance(e.code, str) else "")
|
|
104
105
|
continue
|
|
105
106
|
show(agent.ask(q))
|
|
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
|
{contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
{contextsql_garvit-0.1.3 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|