contextsql-garvit 0.1.2__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.
Files changed (25) hide show
  1. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/PKG-INFO +1 -1
  2. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/cli.py +8 -6
  3. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/PKG-INFO +1 -1
  4. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/pyproject.toml +1 -1
  5. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/README.md +0 -0
  6. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/__init__.py +0 -0
  7. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/agent.py +0 -0
  8. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/autoglossary.py +0 -0
  9. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/config.py +0 -0
  10. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/db.py +0 -0
  11. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/feedback.py +0 -0
  12. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/glossary.py +0 -0
  13. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/hints.py +0 -0
  14. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/introspect.py +0 -0
  15. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/learn.py +0 -0
  16. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/names.py +0 -0
  17. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/phrasing.py +0 -0
  18. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/prompt.py +0 -0
  19. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql/retrieve.py +0 -0
  20. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/SOURCES.txt +0 -0
  21. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/dependency_links.txt +0 -0
  22. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/entry_points.txt +0 -0
  23. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/requires.txt +0 -0
  24. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/contextsql_garvit.egg-info/top_level.txt +0 -0
  25. {contextsql_garvit-0.1.2 → contextsql_garvit-0.1.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: contextsql_garvit
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Local, free, business-context-aware text-to-SQL agent
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -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-v4-q4_k_m.gguf"
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
- if not cfg.get("model") or not Path(cfg["model"]).exists():
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,16 +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
- main(shlex.split(q[1:] if q.startswith("/") else q[11:]))
101
- except SystemExit as e:
100
+ try:
101
+ cmd = q[1:] if q.startswith("/") else q[11:]
102
+ main(["fix", cmd[4:].strip()] if cmd.startswith("fix ") else shlex.split(cmd))
103
+ except SystemExit as e:
102
104
  print(e.code if isinstance(e.code, str) else "")
103
105
  continue
104
106
  show(agent.ask(q))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: contextsql_garvit
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Local, free, business-context-aware text-to-SQL agent
5
5
  Requires-Python: >=3.9
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "contextsql_garvit"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  description = "Local, free, business-context-aware text-to-SQL agent"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"