biblemate 0.0.27__py3-none-any.whl → 0.0.28__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/config.py +2 -1
- biblemate/main.py +27 -8
- {biblemate-0.0.27.dist-info → biblemate-0.0.28.dist-info}/METADATA +1 -1
- {biblemate-0.0.27.dist-info → biblemate-0.0.28.dist-info}/RECORD +7 -7
- {biblemate-0.0.27.dist-info → biblemate-0.0.28.dist-info}/WHEEL +0 -0
- {biblemate-0.0.27.dist-info → biblemate-0.0.28.dist-info}/entry_points.txt +0 -0
- {biblemate-0.0.27.dist-info → biblemate-0.0.28.dist-info}/top_level.txt +0 -0
biblemate/config.py
CHANGED
biblemate/main.py
CHANGED
@@ -92,11 +92,13 @@ def backup_conversation(console, messages, master_plan):
|
|
92
92
|
writeTextFile(conversation_file, str(messages))
|
93
93
|
# Save master plan
|
94
94
|
writeTextFile(os.path.join(storagePath, "master_plan.md"), master_plan)
|
95
|
+
# Save markdown
|
96
|
+
markdown_file = os.path.join(storagePath, "conversation.md")
|
97
|
+
markdown_text = "\n\n".join([f"```{role}\n{content}\n```" for role, content in messages.items() if role in ("user", "assistant")])
|
98
|
+
writeTextFile(markdown_file, markdown_text)
|
95
99
|
# Save html
|
96
100
|
html_file = os.path.join(storagePath, "conversation.html")
|
97
101
|
console.save_html(html_file, inline_styles=True, theme=MONOKAI)
|
98
|
-
# Save markdown
|
99
|
-
console.save_text(os.path.join(storagePath, "conversation.md"))
|
100
102
|
# Inform users of the backup location
|
101
103
|
print(f"Conversation backup saved to {storagePath}")
|
102
104
|
print(f"Report saved to {html_file}\n")
|
@@ -203,6 +205,7 @@ async def main_async():
|
|
203
205
|
".promptengineering": "toggle auto prompt engineering",
|
204
206
|
".steps": "configure the maximum number of steps allowed",
|
205
207
|
".backup": "backup conversation",
|
208
|
+
".load": "load a saved conversation",
|
206
209
|
".open": "open a file or directory",
|
207
210
|
".help": "help page",
|
208
211
|
}
|
@@ -227,10 +230,22 @@ async def main_async():
|
|
227
230
|
# system command
|
228
231
|
if user_request == ".open":
|
229
232
|
user_request = f".open {os.getcwd()}"
|
230
|
-
if user_request.startswith(".open "):
|
233
|
+
if user_request.startswith(".open ") and os.path.exists(user_request[6:]):
|
231
234
|
cmd = f'''{getOpenCommand()} "{user_request[6:]}"'''
|
232
235
|
subprocess.Popen(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
233
236
|
continue
|
237
|
+
elif user_request.startswith(".load") and user_request.endswith(".py") and os.path.isfile(user_request[6:]):
|
238
|
+
try:
|
239
|
+
backup_conversation(console, messages, master_plan)
|
240
|
+
with open(user_request[6:], "r", encoding="utf-8") as f:
|
241
|
+
messages = eval(f.read())
|
242
|
+
user_request = ""
|
243
|
+
master_plan = ""
|
244
|
+
console.clear()
|
245
|
+
console.print(get_banner())
|
246
|
+
continue
|
247
|
+
except Exception as e:
|
248
|
+
pass
|
234
249
|
|
235
250
|
# predefined operations with `.` commands
|
236
251
|
if user_request in action_list:
|
@@ -282,11 +297,12 @@ async def main_async():
|
|
282
297
|
console.rule()
|
283
298
|
console.print("Agent Mode Enabled", justify="center")
|
284
299
|
console.rule()
|
285
|
-
elif user_request in (".new", ".quit"):
|
300
|
+
elif user_request in (".new", ".quit"): # TODO: .load
|
286
301
|
backup_conversation(console, messages, master_plan) # backup
|
287
302
|
# reset
|
288
303
|
if user_request == ".new":
|
289
304
|
user_request = ""
|
305
|
+
master_plan = ""
|
290
306
|
messages = []
|
291
307
|
console.clear()
|
292
308
|
console.print(get_banner())
|
@@ -430,21 +446,24 @@ Available tools are: {available_tools}.
|
|
430
446
|
suggested_tools = []
|
431
447
|
async def get_tool_suggestion():
|
432
448
|
nonlocal suggested_tools, next_suggestion, system_tool_selection
|
433
|
-
if DEVELOPER_MODE:
|
449
|
+
if DEVELOPER_MODE and not config.hide_tools_order:
|
434
450
|
console.print(Markdown(f"## Tool Selection (descending order by relevance) [{step}]"), "\n")
|
435
451
|
else:
|
436
452
|
console.print(Markdown(f"## Tool Selection [{step}]"), "\n")
|
437
453
|
# Extract suggested tools from the step suggestion
|
438
454
|
suggested_tools = agentmake(next_suggestion, system=system_tool_selection, **AGENTMAKE_CONFIG)[-1].get("content", "").strip() # Note: suggested tools are printed on terminal by default, could be hidden by setting `print_on_terminal` to false
|
439
455
|
suggested_tools = re.sub(r"^.*?(\[.*?\]).*?$", r"\1", suggested_tools, flags=re.DOTALL)
|
440
|
-
|
456
|
+
try:
|
457
|
+
suggested_tools = eval(suggested_tools.replace("`", "'")) if suggested_tools.startswith("[") and suggested_tools.endswith("]") else ["get_direct_text_response"] # fallback to direct response
|
458
|
+
except:
|
459
|
+
suggested_tools = ["get_direct_text_response"]
|
441
460
|
await thinking(get_tool_suggestion)
|
442
|
-
if DEVELOPER_MODE:
|
461
|
+
if DEVELOPER_MODE and not config.hide_tools_order:
|
443
462
|
console.print(Markdown(str(suggested_tools)))
|
444
463
|
|
445
464
|
# Use the next suggested tool
|
446
465
|
next_tool = suggested_tools[0] if suggested_tools else "get_direct_text_response"
|
447
|
-
prefix = f"## Next Tool [{step}]\n\n" if DEVELOPER_MODE else ""
|
466
|
+
prefix = f"## Next Tool [{step}]\n\n" if DEVELOPER_MODE and not config.hide_tools_order else ""
|
448
467
|
console.print(Markdown(f"{prefix}`{next_tool}`"))
|
449
468
|
print()
|
450
469
|
|
@@ -1,15 +1,15 @@
|
|
1
1
|
biblemate/README.md,sha256=0xKiXqwB-WBxHCKyUByD-2Yre0zgflTDun-wYc9o-J0,6173
|
2
2
|
biblemate/__init__.py,sha256=aFO4_EperOrwwDBdrkTKfDMt2Fh18Y0A2G_nUC_cmmM,78
|
3
3
|
biblemate/bible_study_mcp.py,sha256=_8m6Glvag6_oYT8z1chnRSwKVbPNF7KQYt0rfW8mC5g,18405
|
4
|
-
biblemate/config.py,sha256=
|
5
|
-
biblemate/main.py,sha256=
|
4
|
+
biblemate/config.py,sha256=qRXTJH_NTgtfyOkqVM_9_izZ2kEtF-_qsfYaeZlBgUA,75
|
5
|
+
biblemate/main.py,sha256=S30FaDi3G0iO6MEHKABqC2X2ux_Xh7Ejg-igRiJJ-50,27424
|
6
6
|
biblemate/package_name.txt,sha256=WkkuEEkgw7EKpXV8GshpzhZlwRor1wpotTS7vP24b_g,9
|
7
7
|
biblemate/requirements.txt,sha256=lry6drnaK9tEIaXy5MAgTb2p5PunsPaaCVjwpeXN7KE,76
|
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=DIvURrf6doEgC7gxbyeGV6gVf4zcP9YAm60gCITs5Sc,4221
|
11
|
-
biblemate-0.0.
|
12
|
-
biblemate-0.0.
|
13
|
-
biblemate-0.0.
|
14
|
-
biblemate-0.0.
|
15
|
-
biblemate-0.0.
|
11
|
+
biblemate-0.0.28.dist-info/METADATA,sha256=9DE9KrnqL2Fwjidydez46bBd-0nQrzRWqSFYebCfMXk,7689
|
12
|
+
biblemate-0.0.28.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
13
|
+
biblemate-0.0.28.dist-info/entry_points.txt,sha256=tbEfTFr6LhPR1E_zP3CsPwJsmG-G4MCnJ3FcQEMiqo0,50
|
14
|
+
biblemate-0.0.28.dist-info/top_level.txt,sha256=pq9uX0tAS0bizZcZ5GW5zIoDLQBa-b5QDlDGsdHNgiU,10
|
15
|
+
biblemate-0.0.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|