dialoghelper 0.0.5__tar.gz → 0.0.6__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.
- {dialoghelper-0.0.5/dialoghelper.egg-info → dialoghelper-0.0.6}/PKG-INFO +1 -1
- dialoghelper-0.0.6/dialoghelper/__init__.py +2 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/dialoghelper/core.py +5 -5
- {dialoghelper-0.0.5 → dialoghelper-0.0.6/dialoghelper.egg-info}/PKG-INFO +1 -1
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/settings.ini +1 -1
- dialoghelper-0.0.5/dialoghelper/__init__.py +0 -2
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/LICENSE +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/MANIFEST.in +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/README.md +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/dialoghelper/_modidx.py +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/dialoghelper.egg-info/SOURCES.txt +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/dialoghelper.egg-info/dependency_links.txt +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/dialoghelper.egg-info/entry_points.txt +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/dialoghelper.egg-info/not-zip-safe +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/dialoghelper.egg-info/requires.txt +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/dialoghelper.egg-info/top_level.txt +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/pyproject.toml +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/setup.cfg +0 -0
- {dialoghelper-0.0.5 → dialoghelper-0.0.6}/setup.py +0 -0
|
@@ -50,7 +50,7 @@ def find_msgs(
|
|
|
50
50
|
pattern: str, # Text to search for
|
|
51
51
|
limit:int=10 # Limit number of returned items
|
|
52
52
|
):
|
|
53
|
-
"Find messages in a specific dialog that contain the given pattern."
|
|
53
|
+
"Find messages in a specific dialog that contain the given pattern. To refer to a message found later, use its `sid` field."
|
|
54
54
|
did = find_dialog_id()
|
|
55
55
|
db = get_db()
|
|
56
56
|
res = db.t.message('did=? AND content LIKE ? ORDER BY mid', [did, f'%{pattern}%'], limit=limit)
|
|
@@ -108,10 +108,10 @@ def add_msg(
|
|
|
108
108
|
msg_type: str='note', # message type, can be 'code', 'note', or 'prompt'
|
|
109
109
|
output:str='', # for prompts/code, initial output
|
|
110
110
|
placement:str='add_after', # can be 'add_after', 'add_before', 'update', 'at_start', 'at_end'
|
|
111
|
-
sid:str=None, #
|
|
111
|
+
sid:str=None, # sid of message that placement is relative to (if None, uses current message)
|
|
112
112
|
**kwargs # additional Message fields such as skipped i/o_collapsed, etc, passed through to the server
|
|
113
113
|
):
|
|
114
|
-
"Add/update a message to the queue to show after code execution completes."
|
|
114
|
+
"Add/update a message to the queue to show after code execution completes. Be sure to pass a `sid` (stable id) not a `mid` (which is used only for sorting, and can change)."
|
|
115
115
|
assert msg_type in ('note', 'code', 'prompt'), "msg_type must be 'code', 'note', or 'prompt'."
|
|
116
116
|
assert msg_type not in ('note') or not output, "'note' messages cannot have an output."
|
|
117
117
|
run_cmd('add_msg', content=content, msg_type=msg_type, output=output, placement=placement, sid=sid, **kwargs)
|
|
@@ -120,10 +120,10 @@ def add_msg(
|
|
|
120
120
|
@delegates(add_msg)
|
|
121
121
|
def update_msg(
|
|
122
122
|
msg:Optional[Dict]=None, # Dictionary of field keys/values to update
|
|
123
|
-
sid:str=None, #
|
|
123
|
+
sid:str=None, # sid of message that placement is relative to (if None, uses current message)
|
|
124
124
|
content:str=None, # content of the message (i.e the message prompt, code, or note text)
|
|
125
125
|
**kwargs):
|
|
126
|
-
"Update an existing message. Provide either `msg` OR field key/values to update. Use `content` param to update contents."
|
|
126
|
+
"Update an existing message. Provide either `msg` OR field key/values to update. Use `content` param to update contents. Be sure to pass a `sid` (stable id) not a `mid` (which is used only for sorting, and can change)."
|
|
127
127
|
if content: kwargs['content']=content
|
|
128
128
|
assert bool(msg)^bool(kwargs), "Provide *either* msg, for kwargs, not both"
|
|
129
129
|
if msg and 'sid' in msg: target_id = msg['sid']
|
|
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
|