biblemate 0.0.21__py3-none-any.whl → 0.0.23__py3-none-any.whl
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/README.md +49 -7
- biblemate/bible_study_mcp.py +19 -0
- biblemate/main.py +17 -9
- {biblemate-0.0.21.dist-info → biblemate-0.0.23.dist-info}/METADATA +50 -8
- {biblemate-0.0.21.dist-info → biblemate-0.0.23.dist-info}/RECORD +8 -8
- {biblemate-0.0.21.dist-info → biblemate-0.0.23.dist-info}/WHEEL +0 -0
- {biblemate-0.0.21.dist-info → biblemate-0.0.23.dist-info}/entry_points.txt +0 -0
- {biblemate-0.0.21.dist-info → biblemate-0.0.23.dist-info}/top_level.txt +0 -0
biblemate/README.md
CHANGED
@@ -61,21 +61,63 @@ How to swap?
|
|
61
61
|
* Enter `.chat` in BibleMate AI prompt to enable chat mode and disable agent mode.
|
62
62
|
* Enter `.agent` in BibleMate AI prompt to enable agent mode and disable chat mode.
|
63
63
|
|
64
|
-
##
|
64
|
+
## Manual Tool Selection
|
65
65
|
|
66
|
+
In some cases, you may want to specify a particular tool for a simple task, rather than having a tool automatically selected in the fully automatic `agent mode`.
|
66
67
|
|
68
|
+
You can specify a single tool by prefixing a tool name with `@` at the beginning of your prompt. For example,
|
67
69
|
|
68
|
-
|
70
|
+
```
|
71
|
+
@retrieve_bible_cross_references Deut 6:4; John 3:16
|
72
|
+
```
|
73
|
+
|
74
|
+
Watch this video: https://youtu.be/50m1KRj6uhs
|
75
|
+
|
76
|
+
## Custom Master Plan with Multiple Tools
|
69
77
|
|
70
|
-
|
78
|
+
In some cases, you may want to specify a `custom plan` with multiple tools specified for different steps for a complex task, rather than having a `master plan` automatically generated in fully automatic agent mode.
|
71
79
|
|
72
|
-
|
80
|
+
You can use a custom 'Master Plan' of your own, instead of one generated by BibleMate AI. To do this, start your BibleMate AI prompt with '@@' followed by your own master plan for a Bible study. For example,
|
73
81
|
|
74
|
-
|
82
|
+
```
|
83
|
+
@@ Analyze John 3:16 with the following steps:
|
84
|
+
1. Call tool 'retrieve_english_bible_verses' for Bible text,
|
85
|
+
2. Call tool 'retrieve_bible_cross_references' for Bible cross-references,
|
86
|
+
3. Call tool 'interpret_new_testament_verse' for interpretation, and
|
87
|
+
4. Call tool 'write_bible_theology' to explain its theology.
|
88
|
+
```
|
75
89
|
|
76
|
-
|
90
|
+
Watch this video: https://youtu.be/Lejq0sAx030
|
91
|
+
|
92
|
+
The '@@' trick works even when you are using 'chat' mode with 'agent' mode disabled.
|
93
|
+
|
94
|
+
## Action Menu
|
77
95
|
|
78
|
-
|
96
|
+
There is a set of predefined entries, that starts with a dot sign `.`:
|
97
|
+
|
98
|
+
- `.new` - new conversation
|
99
|
+
- `.quit` - quit
|
100
|
+
- `.backend` - change backend
|
101
|
+
- `.chat` - enable chat mode
|
102
|
+
- `.agent` - enable agent mode
|
103
|
+
- `.tools` - list available tools
|
104
|
+
- `.backup` - backup conversation
|
105
|
+
- `.open` - open a file or directory, e.g. `.open /home/user/report.html`
|
106
|
+
|
107
|
+
## Keyboard Shortcuts
|
108
|
+
|
109
|
+
The following key bindings are supported in BibleMate AI prompt field:
|
110
|
+
|
111
|
+
- `Ctrl+N` new conversation
|
112
|
+
- `Ctrl+Q` quit
|
113
|
+
- `Ctrl+C` copy selected prompt text
|
114
|
+
- `Ctrl+V` paste text in a prompt
|
115
|
+
- `Ctrl+I` or `TAB` new line
|
116
|
+
- `Ctrl+Z` clear prompt text
|
117
|
+
- `Esc+a` jump to the beginning of a prompt
|
118
|
+
- `Esc+z` jump to the end of a prompt
|
119
|
+
- `Esc+b` or `HOME` jump to the beginning of a line in a prompt
|
120
|
+
- `Esc+e` or `END` jump to the end of a line in a prompt
|
79
121
|
|
80
122
|
## License
|
81
123
|
|
biblemate/bible_study_mcp.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import logging
|
2
2
|
from fastmcp import FastMCP
|
3
|
+
from fastmcp.prompts.prompt import PromptMessage, TextContent
|
3
4
|
from agentmake import agentmake
|
4
5
|
from biblemate import AGENTMAKE_CONFIG
|
5
6
|
|
@@ -347,4 +348,22 @@ def write_bible_sermon(request:str) -> str:
|
|
347
348
|
messages = agentmake(request, **{'instruction': 'bible/sermon', 'system': 'auto'}, **AGENTMAKE_CONFIG)
|
348
349
|
return getResponse(messages)
|
349
350
|
|
351
|
+
@mcp.prompt
|
352
|
+
def simple_bible_study(request:str) -> PromptMessage:
|
353
|
+
"""Perform a simple bible study task; bible reference(s) must be given"""
|
354
|
+
global PromptMessage, TextContent
|
355
|
+
prompt_text = f"""You are a bible study agent. You check the user request, under the `User Request` section, and resolve it with the following steps in order:
|
356
|
+
1. Call tool 'retrieve_english_bible_verses' for Bible text,
|
357
|
+
2. Call tool 'retrieve_bible_cross_references' for Bible cross-references,
|
358
|
+
3. Call tool 'study_old_testament_themes' for study old testament themes or 'study_new_testament_themes' for study old testament themes, and
|
359
|
+
4. Call tool 'write_bible_theology' to explain its theology.
|
360
|
+
|
361
|
+
# User Request
|
362
|
+
|
363
|
+
---
|
364
|
+
{request}
|
365
|
+
---
|
366
|
+
"""
|
367
|
+
return PromptMessage(role="user", content=TextContent(type="text", text=prompt_text))
|
368
|
+
|
350
369
|
mcp.run(show_banner=False)
|
biblemate/main.py
CHANGED
@@ -39,6 +39,7 @@ async def main_async():
|
|
39
39
|
tools_raw = await client.list_tools()
|
40
40
|
#print(tools_raw)
|
41
41
|
tools = {t.name: t.description for t in tools_raw}
|
42
|
+
tools = dict(sorted(tools.items()))
|
42
43
|
tools_schema = {}
|
43
44
|
for t in tools_raw:
|
44
45
|
schema = {
|
@@ -69,6 +70,7 @@ Get a static text-based response directly from a text-based AI model without usi
|
|
69
70
|
prompts_raw = await client.list_prompts()
|
70
71
|
#print("# Prompts\n\n", prompts_raw, "\n\n")
|
71
72
|
prompts = {p.name: p.description for p in prompts_raw}
|
73
|
+
prompts = dict(sorted(prompts.items()))
|
72
74
|
prompt_list = [f"/{p}" for p in prompts.keys()]
|
73
75
|
prompt_pattern = "|".join(prompt_list)
|
74
76
|
prompt_pattern = f"""^({prompt_pattern}) """
|
@@ -176,7 +178,7 @@ Get a static text-based response directly from a text-based AI model without usi
|
|
176
178
|
".agent": "enable agent mode",
|
177
179
|
".tools": "list available tools",
|
178
180
|
#".resources": "list available resources",
|
179
|
-
|
181
|
+
".prompts": "list available prompts",
|
180
182
|
".backup": "backup conversation",
|
181
183
|
".open": "open a file or directory",
|
182
184
|
}
|
@@ -202,6 +204,11 @@ Get a static text-based response directly from a text-based AI model without usi
|
|
202
204
|
tools_descriptions = [f"- `{name}`: {description}" for name, description in tools.items()]
|
203
205
|
console.print(Markdown("## Available Tools\n\n"+"\n".join(tools_descriptions)))
|
204
206
|
console.rule()
|
207
|
+
elif user_request == ".prompts":
|
208
|
+
console.rule()
|
209
|
+
prompts_descriptions = [f"- `{name}`: {description}" for name, description in prompts.items()]
|
210
|
+
console.print(Markdown("## Available Prompts\n\n"+"\n".join(prompts_descriptions)))
|
211
|
+
console.rule()
|
205
212
|
elif user_request == ".backend":
|
206
213
|
edit_configurations()
|
207
214
|
console.rule()
|
@@ -230,8 +237,12 @@ Get a static text-based response directly from a text-based AI model without usi
|
|
230
237
|
continue
|
231
238
|
|
232
239
|
# Check if a single tool is specified
|
240
|
+
specified_prompt = ""
|
233
241
|
specified_tool = ""
|
234
|
-
if re.search(
|
242
|
+
if re.search(prompt_pattern, user_request):
|
243
|
+
specified_prompt = re.search(prompt_pattern, user_request).group(1)
|
244
|
+
user_request = user_request[len(specified_prompt):]
|
245
|
+
elif re.search(f"""^@({available_tools_pattern}) """, user_request):
|
235
246
|
specified_tool = re.search(f"""^@({available_tools_pattern}) """, user_request).group(1)
|
236
247
|
user_request = user_request[len(specified_tool)+2:]
|
237
248
|
elif user_request.startswith("@@"):
|
@@ -302,22 +313,19 @@ Get a static text-based response directly from a text-based AI model without usi
|
|
302
313
|
|
303
314
|
# generate master plan
|
304
315
|
if not master_plan:
|
305
|
-
if
|
306
|
-
prompt_name = re.search(prompt_pattern, user_request).group(1)
|
307
|
-
user_request = user_request[len(prompt_name):]
|
316
|
+
if specified_prompt:
|
308
317
|
# Call the MCP prompt
|
309
|
-
prompt_schema = prompts_schema[
|
318
|
+
prompt_schema = prompts_schema[specified_prompt[1:]]
|
310
319
|
prompt_properties = prompt_schema["parameters"]["properties"]
|
311
320
|
if len(prompt_properties) == 1 and "request" in prompt_properties: # AgentMake MCP Servers or alike
|
312
|
-
result = await client.get_prompt(
|
321
|
+
result = await client.get_prompt(specified_prompt[1:], {"request": user_request})
|
313
322
|
else:
|
314
323
|
structured_output = getDictionaryOutput(messages=messages, schema=prompt_schema)
|
315
|
-
result = await client.get_prompt(
|
324
|
+
result = await client.get_prompt(specified_prompt[1:], structured_output)
|
316
325
|
#print(result, "\n\n")
|
317
326
|
master_plan = result.messages[0].content.text
|
318
327
|
# display info# display info
|
319
328
|
console.print(Markdown(f"# User Request\n\n{user_request}\n\n# Master plan\n\n{master_plan}"))
|
320
|
-
console.print(Markdown(f"# User Request\n\n{user_request}\n\n# Master plan\n\n{master_plan}"))
|
321
329
|
else:
|
322
330
|
# display info
|
323
331
|
console.print(Markdown(f"# User Request\n\n{user_request}"), "\n")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: biblemate
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.23
|
4
4
|
Summary: BibleMate AI - Automate Your Bible Study
|
5
5
|
Home-page: https://toolmate.ai
|
6
6
|
Author: Eliran Wong
|
@@ -94,21 +94,63 @@ How to swap?
|
|
94
94
|
* Enter `.chat` in BibleMate AI prompt to enable chat mode and disable agent mode.
|
95
95
|
* Enter `.agent` in BibleMate AI prompt to enable agent mode and disable chat mode.
|
96
96
|
|
97
|
-
##
|
97
|
+
## Manual Tool Selection
|
98
98
|
|
99
|
+
In some cases, you may want to specify a particular tool for a simple task, rather than having a tool automatically selected in the fully automatic `agent mode`.
|
99
100
|
|
101
|
+
You can specify a single tool by prefixing a tool name with `@` at the beginning of your prompt. For example,
|
100
102
|
|
101
|
-
|
103
|
+
```
|
104
|
+
@retrieve_bible_cross_references Deut 6:4; John 3:16
|
105
|
+
```
|
106
|
+
|
107
|
+
Watch this video: https://youtu.be/50m1KRj6uhs
|
108
|
+
|
109
|
+
## Custom Master Plan with Multiple Tools
|
102
110
|
|
103
|
-
|
111
|
+
In some cases, you may want to specify a `custom plan` with multiple tools specified for different steps for a complex task, rather than having a `master plan` automatically generated in fully automatic agent mode.
|
104
112
|
|
105
|
-
|
113
|
+
You can use a custom 'Master Plan' of your own, instead of one generated by BibleMate AI. To do this, start your BibleMate AI prompt with '@@' followed by your own master plan for a Bible study. For example,
|
106
114
|
|
107
|
-
|
115
|
+
```
|
116
|
+
@@ Analyze John 3:16 with the following steps:
|
117
|
+
1. Call tool 'retrieve_english_bible_verses' for Bible text,
|
118
|
+
2. Call tool 'retrieve_bible_cross_references' for Bible cross-references,
|
119
|
+
3. Call tool 'interpret_new_testament_verse' for interpretation, and
|
120
|
+
4. Call tool 'write_bible_theology' to explain its theology.
|
121
|
+
```
|
108
122
|
|
109
|
-
|
123
|
+
Watch this video: https://youtu.be/Lejq0sAx030
|
124
|
+
|
125
|
+
The '@@' trick works even when you are using 'chat' mode with 'agent' mode disabled.
|
126
|
+
|
127
|
+
## Action Menu
|
110
128
|
|
111
|
-
|
129
|
+
There is a set of predefined entries, that starts with a dot sign `.`:
|
130
|
+
|
131
|
+
- `.new` - new conversation
|
132
|
+
- `.quit` - quit
|
133
|
+
- `.backend` - change backend
|
134
|
+
- `.chat` - enable chat mode
|
135
|
+
- `.agent` - enable agent mode
|
136
|
+
- `.tools` - list available tools
|
137
|
+
- `.backup` - backup conversation
|
138
|
+
- `.open` - open a file or directory, e.g. `.open /home/user/report.html`
|
139
|
+
|
140
|
+
## Keyboard Shortcuts
|
141
|
+
|
142
|
+
The following key bindings are supported in BibleMate AI prompt field:
|
143
|
+
|
144
|
+
- `Ctrl+N` new conversation
|
145
|
+
- `Ctrl+Q` quit
|
146
|
+
- `Ctrl+C` copy selected prompt text
|
147
|
+
- `Ctrl+V` paste text in a prompt
|
148
|
+
- `Ctrl+I` or `TAB` new line
|
149
|
+
- `Ctrl+Z` clear prompt text
|
150
|
+
- `Esc+a` jump to the beginning of a prompt
|
151
|
+
- `Esc+z` jump to the end of a prompt
|
152
|
+
- `Esc+b` or `HOME` jump to the beginning of a line in a prompt
|
153
|
+
- `Esc+e` or `END` jump to the end of a line in a prompt
|
112
154
|
|
113
155
|
## License
|
114
156
|
|
@@ -1,15 +1,15 @@
|
|
1
|
-
biblemate/README.md,sha256=
|
1
|
+
biblemate/README.md,sha256=0xKiXqwB-WBxHCKyUByD-2Yre0zgflTDun-wYc9o-J0,6173
|
2
2
|
biblemate/__init__.py,sha256=aFO4_EperOrwwDBdrkTKfDMt2Fh18Y0A2G_nUC_cmmM,78
|
3
|
-
biblemate/bible_study_mcp.py,sha256
|
3
|
+
biblemate/bible_study_mcp.py,sha256=-g66m7zB-6bQ-rilmUs5-PPAtXdm_qES2mH8nZ7bGG4,17453
|
4
4
|
biblemate/config.py,sha256=ktpLv_5qdbf3FErxUIdCvVc9MO6kQH4Zt_omoJ7msIs,15
|
5
|
-
biblemate/main.py,sha256=
|
5
|
+
biblemate/main.py,sha256=O7PKxdJbmjeIU4NomvkHEuaUuMSmjsttWAIot4_IFvU,22614
|
6
6
|
biblemate/package_name.txt,sha256=WkkuEEkgw7EKpXV8GshpzhZlwRor1wpotTS7vP24b_g,9
|
7
7
|
biblemate/requirements.txt,sha256=MliJX2PmogiVmgqHk4W0TMqRp2FLYXcGIkf8PS2RV94,70
|
8
8
|
biblemate/core/systems.py,sha256=nG_NgcLSRhdaHuxuCPN5ZfJUhP88kdfwhRCvRk4RLjI,1874
|
9
9
|
biblemate/ui/info.py,sha256=QRCno0CYUHVoOtVkZIxVamZONmtI7KRmOT2YoUagY5s,811
|
10
10
|
biblemate/ui/prompts.py,sha256=mxdC5BU7NMok9MOm1E39MHSrxB9gSRqGY7HsOc--rRg,3484
|
11
|
-
biblemate-0.0.
|
12
|
-
biblemate-0.0.
|
13
|
-
biblemate-0.0.
|
14
|
-
biblemate-0.0.
|
15
|
-
biblemate-0.0.
|
11
|
+
biblemate-0.0.23.dist-info/METADATA,sha256=P7UDN6G3rrS7uxAxqTqNIfCP5H-bZaorbjbPuxSRfRI,7668
|
12
|
+
biblemate-0.0.23.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
13
|
+
biblemate-0.0.23.dist-info/entry_points.txt,sha256=tbEfTFr6LhPR1E_zP3CsPwJsmG-G4MCnJ3FcQEMiqo0,50
|
14
|
+
biblemate-0.0.23.dist-info/top_level.txt,sha256=pq9uX0tAS0bizZcZ5GW5zIoDLQBa-b5QDlDGsdHNgiU,10
|
15
|
+
biblemate-0.0.23.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|