dialoghelper 0.0.20__tar.gz → 0.0.21__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.
Potentially problematic release.
This version of dialoghelper might be problematic. Click here for more details.
- {dialoghelper-0.0.20/dialoghelper.egg-info → dialoghelper-0.0.21}/PKG-INFO +1 -1
- dialoghelper-0.0.21/dialoghelper/__init__.py +2 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/dialoghelper/core.py +5 -4
- {dialoghelper-0.0.20 → dialoghelper-0.0.21/dialoghelper.egg-info}/PKG-INFO +1 -1
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/settings.ini +1 -1
- dialoghelper-0.0.20/dialoghelper/__init__.py +0 -2
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/LICENSE +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/MANIFEST.in +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/README.md +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/dialoghelper/_modidx.py +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/dialoghelper/db_dc.py +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/dialoghelper.egg-info/SOURCES.txt +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/dialoghelper.egg-info/dependency_links.txt +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/dialoghelper.egg-info/entry_points.txt +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/dialoghelper.egg-info/not-zip-safe +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/dialoghelper.egg-info/requires.txt +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/dialoghelper.egg-info/top_level.txt +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/pyproject.toml +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/setup.cfg +0 -0
- {dialoghelper-0.0.20 → dialoghelper-0.0.21}/setup.py +0 -0
|
@@ -69,9 +69,9 @@ def find_msg_id():
|
|
|
69
69
|
|
|
70
70
|
# %% ../nbs/00_core.ipynb
|
|
71
71
|
def msg_idx(
|
|
72
|
-
msgid=None
|
|
72
|
+
msgid=None, # Message id to find (defaults to current message)
|
|
73
73
|
):
|
|
74
|
-
"Get
|
|
74
|
+
"Get absolute index of message in dialog."
|
|
75
75
|
if not msgid: msgid = find_msg_id()
|
|
76
76
|
return call_endp('msg_idx_', json=True, msgid=msgid)['msgid']
|
|
77
77
|
|
|
@@ -141,6 +141,7 @@ def _add_msg_unsafe(
|
|
|
141
141
|
|
|
142
142
|
# %% ../nbs/00_core.ipynb
|
|
143
143
|
def _umsg(
|
|
144
|
+
content:str|None=None, # Content of the message (i.e the message prompt, code, or note text)
|
|
144
145
|
msg_type: str|None = None, # Message type, can be 'code', 'note', or 'prompt'
|
|
145
146
|
output:str|None = None, # For prompts/code, the output
|
|
146
147
|
time_run: str | None = None, # When was message executed
|
|
@@ -156,14 +157,13 @@ def _umsg(
|
|
|
156
157
|
@delegates(_umsg)
|
|
157
158
|
def update_msg(
|
|
158
159
|
msgid:str=None, # id of message to update (if None, uses current message)
|
|
159
|
-
content:str|None=None, # Content of the message (i.e the message prompt, code, or note text)
|
|
160
160
|
msg:Optional[Dict]=None, # Dictionary of field keys/values to update
|
|
161
161
|
**kwargs):
|
|
162
162
|
"""Update an existing message. Provide either `msg` OR field key/values to update.
|
|
163
163
|
Use `content` param to update contents.
|
|
164
164
|
Only include parameters to update--missing ones will be left unchanged."""
|
|
165
165
|
if not msgid and not msg: raise TypeError("update_msg needs either a dict message or `msgid=`")
|
|
166
|
-
return call_endp('add_relative_',
|
|
166
|
+
return call_endp('add_relative_', placement='update', msgid=msgid, **kwargs)
|
|
167
167
|
|
|
168
168
|
# %% ../nbs/00_core.ipynb
|
|
169
169
|
def load_gist(gist_id:str):
|
|
@@ -236,6 +236,7 @@ def tool_info():
|
|
|
236
236
|
cts='''Tools available from `dialoghelper`:
|
|
237
237
|
|
|
238
238
|
- &`curr_dialog`: Get the current dialog info.
|
|
239
|
+
- &`msg_idx`: Get absolute index of message in dialog.
|
|
239
240
|
- &`add_html`: Send HTML to the browser to be swapped into the DOM using hx-swap-oob.
|
|
240
241
|
- &`find_msg_id`: Get the current message id.
|
|
241
242
|
- &`find_msgs`: Find messages in current specific dialog that contain the given information.
|
|
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
|
|
File without changes
|
|
File without changes
|