Skip to content

Commit b9e3e30

Browse files
committed
fixes #73
1 parent c19faae commit b9e3e30

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

dialoghelper/core.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ def find_msgs(
151151
include_output:bool=True, # Include output in returned dict?
152152
dname:str='' # Running dialog to get info for; defaults to current dialog
153153
):
154-
"Find `list[dict]` of messages in current specific dialog that contain the given information. Call with no args to see the full dialog. To refer to a message found later, use its `id` field."
154+
"""Find `list[dict]` of messages in current specific dialog that contain the given information. Call with no args to see the full dialog.
155+
Message ids are identical to those in LLM chat history, so do NOT call this to view a specific message -- instead use `read_msgid`.
156+
Note that LLM chat history only includes messages above the current prompt, whereas `find_msgs` can access *all* messages.
157+
To refer to a message found later, use its `id` field."""
155158
res = call_endp('find_msgs_', dname, json=True, re_pattern=re_pattern, msg_type=msg_type, limit=limit)['msgs']
156159
if not include_output:
157160
for o in res: o.pop('output', None)
@@ -196,7 +199,7 @@ def read_msgid(
196199
nums:bool=False, # Whether to show line numbers
197200
dname:str='' # Running dialog to get info for; defaults to current dialog
198201
):
199-
"""Get message `msgid`. Shortcut for `read_msg(n=0, relative=True, msgid=msgid...)`."""
202+
"""Get message `msgid`. Message IDs can be view directly in LLM chat history/context, or found in `find_msgs` results."""
200203
return read_msg(0, msgid=msgid, view_range=view_range, nums=nums, dname=dname)
201204

202205
# %% ../nbs/00_core.ipynb

nbs/00_core.ipynb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,10 @@
520520
" include_output:bool=True, # Include output in returned dict?\n",
521521
" dname:str='' # Running dialog to get info for; defaults to current dialog\n",
522522
"):\n",
523-
" \"Find `list[dict]` of messages in current specific dialog that contain the given information. Call with no args to see the full dialog. To refer to a message found later, use its `id` field.\"\n",
523+
" \"\"\"Find `list[dict]` of messages in current specific dialog that contain the given information. Call with no args to see the full dialog.\n",
524+
" Message ids are identical to those in LLM chat history, so do NOT call this to view a specific message -- instead use `read_msgid`.\n",
525+
" Note that LLM chat history only includes messages above the current prompt, whereas `find_msgs` can access *all* messages.\n",
526+
" To refer to a message found later, use its `id` field.\"\"\"\n",
524527
" res = call_endp('find_msgs_', dname, json=True, re_pattern=re_pattern, msg_type=msg_type, limit=limit)['msgs']\n",
525528
" if not include_output:\n",
526529
" for o in res: o.pop('output', None)\n",
@@ -661,7 +664,7 @@
661664
" nums:bool=False, # Whether to show line numbers\n",
662665
" dname:str='' # Running dialog to get info for; defaults to current dialog\n",
663666
" ):\n",
664-
" \"\"\"Get message `msgid`. Shortcut for `read_msg(n=0, relative=True, msgid=msgid...)`.\"\"\"\n",
667+
" \"\"\"Get message `msgid`. Message IDs can be view directly in LLM chat history/context, or found in `find_msgs` results.\"\"\"\n",
665668
" return read_msg(0, msgid=msgid, view_range=view_range, nums=nums, dname=dname)"
666669
]
667670
},

0 commit comments

Comments
 (0)