biblemate 0.2.56__tar.gz → 0.2.58__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.
- {biblemate-0.2.56 → biblemate-0.2.58}/PKG-INFO +1 -1
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/__init__.py +6 -3
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/api/add_vector.py +6 -6
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/api/bible.py +3 -3
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/bible_study_mcp.py +5 -5
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/main.py +3 -3
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/requirements.txt +1 -1
- biblemate-0.2.58/biblemate/version.txt +1 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate.egg-info/PKG-INFO +1 -1
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate.egg-info/requires.txt +1 -1
- {biblemate-0.2.56 → biblemate-0.2.58}/setup.py +1 -1
- biblemate-0.2.56/biblemate/version.txt +0 -1
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/README.md +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/api/api.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/api/dialogs.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/api/search.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/biblematemcp.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/config.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/core/systems.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/etextedit/README.md +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/etextedit/plugins/Extract Bible References.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/etextedit/plugins/Insert Bible Text.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/package_name.txt +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/ui/info.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/ui/prompts.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/ui/selection_dialog.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate/ui/text_area.py +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate.egg-info/SOURCES.txt +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate.egg-info/dependency_links.txt +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate.egg-info/entry_points.txt +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/biblemate.egg-info/top_level.txt +0 -0
- {biblemate-0.2.56 → biblemate-0.2.58}/setup.cfg +0 -0
|
@@ -252,9 +252,12 @@ AGENTMAKE_CONFIG = {
|
|
|
252
252
|
}
|
|
253
253
|
OLLAMA_NOT_FOUND = "`Ollama` is not found! BibleMate AI uses `Ollama` to generate embeddings for semantic searches. You may install it from https://ollama.com/ so that you can perform semantic searches of the Bible with BibleMate AI."
|
|
254
254
|
BIBLEMATE_VERSION = readTextFile(os.path.join(os.path.dirname(os.path.realpath(__file__)), "version.txt"))
|
|
255
|
-
BIBLEMATEDATA = os.path.join(AGENTMAKE_USER_DIR, "biblemate", "data")
|
|
256
|
-
if not os.path.isdir(BIBLEMATEDATA):
|
|
257
|
-
Path(BIBLEMATEDATA).mkdir(parents=True, exist_ok=True)
|
|
255
|
+
#BIBLEMATEDATA = os.path.join(AGENTMAKE_USER_DIR, "biblemate", "data")
|
|
256
|
+
#if not os.path.isdir(BIBLEMATEDATA):
|
|
257
|
+
# Path(BIBLEMATEDATA).mkdir(parents=True, exist_ok=True)
|
|
258
|
+
BIBLEMATEVECTORSTORE = os.path.join(os.path.expanduser("~"), "biblemate", "data", "vectors")
|
|
259
|
+
if not os.path.isdir(BIBLEMATEVECTORSTORE):
|
|
260
|
+
Path(BIBLEMATEVECTORSTORE).mkdir(parents=True, exist_ok=True)
|
|
258
261
|
BIBLEMATETEMP = os.path.join(os.path.dirname(os.path.realpath(__file__)), "temp")
|
|
259
262
|
if not os.path.isdir(BIBLEMATETEMP):
|
|
260
263
|
Path(BIBLEMATETEMP).mkdir(parents=True, exist_ok=True)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import apsw, re, os, json
|
|
2
2
|
from agentmake.utils.rag import get_embeddings
|
|
3
3
|
from prompt_toolkit.shortcuts import ProgressBar
|
|
4
|
-
from biblemate import config,
|
|
4
|
+
from biblemate import config, BIBLEMATEVECTORSTORE
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
def add_vector_data(db_file="dictionary.db", table="Dictionary", h2=False):
|
|
8
|
-
db_file = os.path.join(
|
|
8
|
+
db_file = os.path.join(BIBLEMATEVECTORSTORE, db_file)
|
|
9
9
|
if os.path.isfile(db_file):
|
|
10
10
|
with apsw.Connection(db_file) as connection:
|
|
11
11
|
cursor = connection.cursor()
|
|
@@ -31,7 +31,7 @@ def add_vector_data(db_file="dictionary.db", table="Dictionary", h2=False):
|
|
|
31
31
|
|
|
32
32
|
def add_vector_names(create_table=True):
|
|
33
33
|
from uniquebible.util.HBN import HBN
|
|
34
|
-
db_file = os.path.join(
|
|
34
|
+
db_file = os.path.join(BIBLEMATEVECTORSTORE, "exlb.db")
|
|
35
35
|
table = "exlbn"
|
|
36
36
|
if os.path.isfile(db_file):
|
|
37
37
|
with apsw.Connection(db_file) as connection:
|
|
@@ -54,7 +54,7 @@ CREATE TABLE IF NOT EXISTS {table} (
|
|
|
54
54
|
#cursor.execute(f"VACUUM;")
|
|
55
55
|
|
|
56
56
|
def fix_vector_collections(db_file="collection.db", table="PARALLEL"):
|
|
57
|
-
db_file = os.path.join(
|
|
57
|
+
db_file = os.path.join(BIBLEMATEVECTORSTORE, db_file)
|
|
58
58
|
if os.path.isfile(db_file):
|
|
59
59
|
with apsw.Connection(db_file) as connection:
|
|
60
60
|
cursor = connection.cursor()
|
|
@@ -69,7 +69,7 @@ def fix_vector_collections(db_file="collection.db", table="PARALLEL"):
|
|
|
69
69
|
#cursor.execute(f"VACUUM;")
|
|
70
70
|
|
|
71
71
|
def add_vector_collections(db_file="collection.db", table="PROMISES", h2=False):
|
|
72
|
-
db_file = os.path.join(
|
|
72
|
+
db_file = os.path.join(BIBLEMATEVECTORSTORE, db_file)
|
|
73
73
|
if os.path.isfile(db_file):
|
|
74
74
|
with apsw.Connection(db_file) as connection:
|
|
75
75
|
cursor = connection.cursor()
|
|
@@ -97,7 +97,7 @@ def add_vector_collections(db_file="collection.db", table="PROMISES", h2=False):
|
|
|
97
97
|
#cursor.execute(f"VACUUM;")
|
|
98
98
|
|
|
99
99
|
def add_vector_encyclopedias():
|
|
100
|
-
db_file = os.path.join(
|
|
100
|
+
db_file = os.path.join(BIBLEMATEVECTORSTORE, "encyclopedia.db")
|
|
101
101
|
if os.path.isfile(db_file):
|
|
102
102
|
with apsw.Connection(db_file) as connection:
|
|
103
103
|
cursor = connection.cursor()
|
|
@@ -4,7 +4,7 @@ import json, os, re
|
|
|
4
4
|
from agentmake import OllamaAI, OLLAMA_FOUND, OLLAMA_NOT_FOUND_MESSAGE, AGENTMAKE_USER_DIR, agentmake, getDictionaryOutput
|
|
5
5
|
from agentmake.utils.rag import get_embeddings, cosine_similarity_matrix
|
|
6
6
|
from prompt_toolkit.shortcuts import ProgressBar
|
|
7
|
-
from biblemate import config,
|
|
7
|
+
from biblemate import config, BIBLEMATEVECTORSTORE
|
|
8
8
|
from biblemate.api.api import run_bm_api
|
|
9
9
|
from agentmake.plugins.uba.lib.BibleBooks import BibleBooks
|
|
10
10
|
from agentmake.backends.ollama import OllamaAI
|
|
@@ -43,7 +43,7 @@ def search_bible(request:str, book:int=0, module=config.default_bible, search_re
|
|
|
43
43
|
exact_matches_content = run_bm_api(f"literal:::{abbr[str(book)][0]},{module}:::{search_string}" if book else f"literal:::{module}:::{search_string}")
|
|
44
44
|
|
|
45
45
|
# semantic matches
|
|
46
|
-
bible_file = os.path.join(
|
|
46
|
+
bible_file = os.path.join(BIBLEMATEVECTORSTORE, "bible.db")
|
|
47
47
|
if not OLLAMA_FOUND:
|
|
48
48
|
semantic_matches = []
|
|
49
49
|
semantic_matches_content = f"[{OLLAMA_NOT_FOUND_MESSAGE}]"
|
|
@@ -86,7 +86,7 @@ class BibleVectorDatabase:
|
|
|
86
86
|
|
|
87
87
|
def __init__(self, uba_bible_path: str=None):
|
|
88
88
|
if not uba_bible_path:
|
|
89
|
-
uba_bible_path = os.path.join(
|
|
89
|
+
uba_bible_path = os.path.join(BIBLEMATEVECTORSTORE, "bible.db")
|
|
90
90
|
# check if file exists
|
|
91
91
|
if os.path.isfile(uba_bible_path):
|
|
92
92
|
# Download embedding model
|
|
@@ -5,7 +5,7 @@ from fastmcp import FastMCP
|
|
|
5
5
|
from fastmcp.prompts.prompt import PromptMessage, TextContent
|
|
6
6
|
from agentmake import agentmake, DEVELOPER_MODE
|
|
7
7
|
from agentmake.plugins.uba.lib.BibleParser import BibleVerseParser
|
|
8
|
-
from biblemate import BIBLEMATE_VERSION,
|
|
8
|
+
from biblemate import BIBLEMATE_VERSION, BIBLEMATEVECTORSTORE, AGENTMAKE_CONFIG, config
|
|
9
9
|
from biblemate.api.bible import search_bible
|
|
10
10
|
from biblemate.api.api import run_bm_api
|
|
11
11
|
from biblemate.api.search import UBASearches
|
|
@@ -134,7 +134,7 @@ def dictionaries() -> dict:
|
|
|
134
134
|
resources = json.loads(run_bm_api(".resources"))
|
|
135
135
|
return dict(zip(resources["dictionaryListAbb"], resources["dictionaryList"]))
|
|
136
136
|
|
|
137
|
-
dictionary_db = os.path.join(
|
|
137
|
+
dictionary_db = os.path.join(BIBLEMATEVECTORSTORE, "dictionary.db")
|
|
138
138
|
if os.path.isfile(dictionary_db):
|
|
139
139
|
@mcp.resource("dictionary://{query}")
|
|
140
140
|
def dictionary(query:str) -> Union[str, list]:
|
|
@@ -155,7 +155,7 @@ def encyclopedias() -> dict:
|
|
|
155
155
|
resources = json.loads(run_bm_api(".resources"))
|
|
156
156
|
return dict(zip(resources["encyclopediaListAbb"], resources["encyclopediaList"]))
|
|
157
157
|
|
|
158
|
-
encyclopedia_db = os.path.join(
|
|
158
|
+
encyclopedia_db = os.path.join(BIBLEMATEVECTORSTORE, "encyclopedia.db")
|
|
159
159
|
if os.path.isfile(encyclopedia_db):
|
|
160
160
|
@mcp.resource("encyclopedia://{module}/{query}")
|
|
161
161
|
def encyclopedia(module: str, query:str) -> Union[str, list]:
|
|
@@ -203,7 +203,7 @@ def topics() -> dict:
|
|
|
203
203
|
resources = json.loads(run_bm_api(".resources"))
|
|
204
204
|
return dict(zip(resources["topicListAbb"], resources["topicList"]))
|
|
205
205
|
|
|
206
|
-
collection_db = os.path.join(
|
|
206
|
+
collection_db = os.path.join(BIBLEMATEVECTORSTORE, "collection.db")
|
|
207
207
|
if os.path.isfile(collection_db):
|
|
208
208
|
@mcp.resource("parallel://{module}/{query}")
|
|
209
209
|
def parallel(module:str, query:str) -> Union[str, list]:
|
|
@@ -228,7 +228,7 @@ if os.path.isfile(collection_db):
|
|
|
228
228
|
bible=module,
|
|
229
229
|
)
|
|
230
230
|
|
|
231
|
-
topic_db = os.path.join(
|
|
231
|
+
topic_db = os.path.join(BIBLEMATEVECTORSTORE, "exlb.db")
|
|
232
232
|
if os.path.isfile(topic_db):
|
|
233
233
|
@mcp.resource("topic://{query}")
|
|
234
234
|
def topic(query:str) -> Union[str, list]:
|
|
@@ -2,7 +2,7 @@ from biblemate.core.systems import *
|
|
|
2
2
|
from biblemate.api.dialogs import *
|
|
3
3
|
from biblemate.ui.text_area import getTextArea
|
|
4
4
|
from biblemate.ui.info import get_banner
|
|
5
|
-
from biblemate import config, CONFIG_FILE_BACKUP, DIALOGS, BIBLEMATE_VERSION, AGENTMAKE_CONFIG, BIBLEMATE_USER_DIR,
|
|
5
|
+
from biblemate import config, CONFIG_FILE_BACKUP, DIALOGS, BIBLEMATE_VERSION, AGENTMAKE_CONFIG, BIBLEMATE_USER_DIR, BIBLEMATEVECTORSTORE, fix_string, write_user_config, list_dir_content
|
|
6
6
|
from biblemate.api.api import DEFAULT_MODULES, run_bm_api
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
import urllib.parse
|
|
@@ -270,14 +270,14 @@ async def download_data(console, default=""):
|
|
|
270
270
|
default=default,
|
|
271
271
|
)
|
|
272
272
|
if file_id:
|
|
273
|
-
output = os.path.join(
|
|
273
|
+
output = os.path.join(BIBLEMATEVECTORSTORE, file_id+".zip")
|
|
274
274
|
if os.path.isfile(output):
|
|
275
275
|
os.remove(output)
|
|
276
276
|
if os.path.isfile(output[:-4]):
|
|
277
277
|
os.remove(output[:-4])
|
|
278
278
|
gdown.download(id=file_ids[file_id], output=output)
|
|
279
279
|
with zipfile.ZipFile(output, 'r') as zip_ref:
|
|
280
|
-
zip_ref.extractall(
|
|
280
|
+
zip_ref.extractall(BIBLEMATEVECTORSTORE)
|
|
281
281
|
if os.path.isfile(output):
|
|
282
282
|
os.remove(output)
|
|
283
283
|
info = "Restart to make the changes effective!"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.58
|
|
@@ -2,7 +2,7 @@ from setuptools import setup
|
|
|
2
2
|
from setuptools.command.install import install
|
|
3
3
|
import os, shutil, platform, sys
|
|
4
4
|
|
|
5
|
-
version = "0.2.
|
|
5
|
+
version = "0.2.58"
|
|
6
6
|
with open(os.path.join("biblemate", "version.txt"), "w", encoding="utf-8") as fileObj:
|
|
7
7
|
fileObj.write(version)
|
|
8
8
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.2.56
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{biblemate-0.2.56 → biblemate-0.2.58}/biblemate/etextedit/plugins/Extract Bible References.py
RENAMED
|
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
|