litdb 2.0.1__tar.gz → 2.0.2__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.
- {litdb-2.0.1 → litdb-2.0.2}/PKG-INFO +1 -1
- {litdb-2.0.1 → litdb-2.0.2}/pyproject.toml +2 -2
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb/cli.py +3 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb/gpt.py +5 -2
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb/utils.py +2 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb.egg-info/PKG-INFO +1 -1
- {litdb-2.0.1 → litdb-2.0.2}/README.org +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/setup.cfg +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb/__init__.py +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb/bibtex.py +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb/coa.py +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb/db.py +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb/lab.py +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb/openalex.py +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb/pdf.py +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb.egg-info/SOURCES.txt +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb.egg-info/dependency_links.txt +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb.egg-info/entry_points.txt +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb.egg-info/requires.txt +0 -0
- {litdb-2.0.1 → litdb-2.0.2}/src/litdb.egg-info/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ where = ["src"]
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "litdb"
|
|
10
|
-
version = "2.0.
|
|
10
|
+
version = "2.0.2"
|
|
11
11
|
authors = [
|
|
12
12
|
{name = "John Kitchin", email = "jkitchin@andrew.cmu.edu"},
|
|
13
13
|
]
|
|
@@ -60,4 +60,4 @@ litdb = "litdb.cli:cli"
|
|
|
60
60
|
Homepage = "https://github.com/jkitchin/litdb"
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
# uv build & uv publish
|
|
63
|
+
# (shell-command "uv build & uv publish")
|
|
@@ -4,6 +4,8 @@ import os
|
|
|
4
4
|
import readline
|
|
5
5
|
import subprocess
|
|
6
6
|
|
|
7
|
+
from IPython import embed
|
|
8
|
+
from traitlets.config import Config
|
|
7
9
|
import numpy as np
|
|
8
10
|
import ollama
|
|
9
11
|
from rich import print as richprint
|
|
@@ -71,7 +73,7 @@ The following subcommands can be used:
|
|
|
71
73
|
os.system(prompt[1:].strip())
|
|
72
74
|
continue
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
# a little sub-language of commands
|
|
75
77
|
elif prompt == "!save":
|
|
76
78
|
with open(input("Filename (chat.txt): ") or "chat.txt", "w") as f:
|
|
77
79
|
for message in messages:
|
|
@@ -102,7 +104,8 @@ The following subcommands can be used:
|
|
|
102
104
|
# RAG by vector search
|
|
103
105
|
emb = model.encode([prompt]).astype(np.float32).tobytes()
|
|
104
106
|
data = db.execute(
|
|
105
|
-
"""
|
|
107
|
+
"""\
|
|
108
|
+
select sources.text, json_extract(sources.extra, '$.citation')
|
|
106
109
|
from vector_top_k('embedding_idx', ?, 3)
|
|
107
110
|
join sources on sources.rowid = id""",
|
|
108
111
|
(emb,),
|
|
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
|