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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: litdb
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: A literature database tool with GPT integration.
5
5
  Author-email: John Kitchin <jkitchin@andrew.cmu.edu>
6
6
  Maintainer-email: John Kitchin <jkitchin@andrew.cmu.edu>
@@ -7,7 +7,7 @@ where = ["src"]
7
7
 
8
8
  [project]
9
9
  name = "litdb"
10
- version = "2.0.1"
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")
@@ -54,8 +54,11 @@ def cli():
54
54
  def init():
55
55
  """Initialize a litdb directory in the current working directory."""
56
56
  init_litdb()
57
+ db = get_db()
58
+
57
59
  with click.Context(about) as ctx:
58
60
  ctx.invoke(about)
61
+
59
62
  return db
60
63
 
61
64
 
@@ -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
- # a little sub-language of commands
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
- """select sources.text, json_extract(sources.extra, '$.citation')
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,),
@@ -18,6 +18,8 @@ def find_root_directory(rootfile="litdb.toml"):
18
18
 
19
19
 
20
20
  def init_litdb():
21
+ """Initialize litdb in the current directory.
22
+ This just creates the config."""
21
23
  email = input("Email address: ")
22
24
  api_key = input("OpenAlex API key (Enter if None): ")
23
25
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: litdb
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: A literature database tool with GPT integration.
5
5
  Author-email: John Kitchin <jkitchin@andrew.cmu.edu>
6
6
  Maintainer-email: John Kitchin <jkitchin@andrew.cmu.edu>
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