dialoghelper 0.0.3__tar.gz → 0.0.4__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.3/dialoghelper.egg-info → dialoghelper-0.0.4}/PKG-INFO +1 -1
- dialoghelper-0.0.4/dialoghelper/__init__.py +2 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/dialoghelper/_modidx.py +2 -1
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/dialoghelper/core.py +21 -6
- {dialoghelper-0.0.3 → dialoghelper-0.0.4/dialoghelper.egg-info}/PKG-INFO +1 -1
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/settings.ini +1 -1
- dialoghelper-0.0.3/dialoghelper/__init__.py +0 -2
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/LICENSE +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/MANIFEST.in +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/README.md +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/dialoghelper.egg-info/SOURCES.txt +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/dialoghelper.egg-info/dependency_links.txt +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/dialoghelper.egg-info/entry_points.txt +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/dialoghelper.egg-info/not-zip-safe +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/dialoghelper.egg-info/requires.txt +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/dialoghelper.egg-info/top_level.txt +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/pyproject.toml +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/setup.cfg +0 -0
- {dialoghelper-0.0.3 → dialoghelper-0.0.4}/setup.py +0 -0
|
@@ -5,7 +5,8 @@ d = { 'settings': { 'branch': 'main',
|
|
|
5
5
|
'doc_host': 'https://AnswerDotAI.github.io',
|
|
6
6
|
'git_url': 'https://github.com/AnswerDotAI/dialoghelper',
|
|
7
7
|
'lib_path': 'dialoghelper'},
|
|
8
|
-
'syms': { 'dialoghelper.core': { 'dialoghelper.core.
|
|
8
|
+
'syms': { 'dialoghelper.core': { 'dialoghelper.core._msg': ('core.html#_msg', 'dialoghelper/core.py'),
|
|
9
|
+
'dialoghelper.core.add_html': ('core.html#add_html', 'dialoghelper/core.py'),
|
|
9
10
|
'dialoghelper.core.add_msg': ('core.html#add_msg', 'dialoghelper/core.py'),
|
|
10
11
|
'dialoghelper.core.find_dialog_id': ('core.html#find_dialog_id', 'dialoghelper/core.py'),
|
|
11
12
|
'dialoghelper.core.find_msg_id': ('core.html#find_msg_id', 'dialoghelper/core.py'),
|
|
@@ -10,6 +10,7 @@ from tempfile import TemporaryDirectory
|
|
|
10
10
|
from ipykernel_helper import *
|
|
11
11
|
|
|
12
12
|
from fastcore.utils import *
|
|
13
|
+
from fastcore.meta import delegates
|
|
13
14
|
from ghapi.all import *
|
|
14
15
|
from fastlite import *
|
|
15
16
|
|
|
@@ -81,18 +82,32 @@ def read_msg(n:int=-1, # Message index (if relative, +ve is downwards)
|
|
|
81
82
|
return db.t.message.fetchone('sid=?', [ids[idx]])
|
|
82
83
|
|
|
83
84
|
# %% ../nbs/00_core.ipynb
|
|
85
|
+
def _msg(
|
|
86
|
+
input_tokens: int | None = 0,
|
|
87
|
+
output_tokens: int | None = 0,
|
|
88
|
+
time_run: str | None = '',
|
|
89
|
+
is_exported: int | None = 0,
|
|
90
|
+
skipped: int | None = 0,
|
|
91
|
+
did: int | None = None,
|
|
92
|
+
i_collapsed: int | None = 0,
|
|
93
|
+
o_collapsed: int | None = 0,
|
|
94
|
+
header_collapsed: int | None = 0,
|
|
95
|
+
pinned: int | None = 0
|
|
96
|
+
): ...
|
|
97
|
+
|
|
98
|
+
# %% ../nbs/00_core.ipynb
|
|
99
|
+
@delegates(_msg)
|
|
84
100
|
def add_msg(
|
|
85
101
|
content:str, # message that we are updating or adding before/after
|
|
86
102
|
msg_type: str='note', # message type, can be 'code', 'note', or 'prompt'
|
|
87
|
-
output='', # for prompts/code, initial output
|
|
88
|
-
placement='add_after', # can be 'add_after', 'add_before', 'update', 'at_start', 'at_end'
|
|
103
|
+
output:str='', # for prompts/code, initial output
|
|
104
|
+
placement:str='add_after', # can be 'add_after', 'add_before', 'update', 'at_start', 'at_end'
|
|
89
105
|
msg_id:str=None, # id of message that placement is relative to (if None, uses current message)
|
|
90
|
-
**
|
|
106
|
+
**kwargs # additional Message fields such as skipped i/o_collapsed, etc, passed through to the server
|
|
91
107
|
):
|
|
92
108
|
"Add/update a message to the queue to show after code execution completes."
|
|
93
109
|
assert msg_type in ('note', 'code', 'prompt'), "msg_type must be 'code', 'note', or 'prompt'."
|
|
94
|
-
|
|
95
|
-
run_cmd('add_msg', content=content, msg_type=msg_type, output=output, placement=placement, msg_id=msg_id, **kw)
|
|
110
|
+
run_cmd('add_msg', content=content, msg_type=msg_type, output=output, placement=placement, msg_id=msg_id, **kwargs)
|
|
96
111
|
|
|
97
112
|
# %% ../nbs/00_core.ipynb
|
|
98
113
|
def update_msg(msg: dict):
|
|
@@ -101,7 +116,7 @@ def update_msg(msg: dict):
|
|
|
101
116
|
exclude = {'id', 'content', 'msg_type', 'output'} # explicit args
|
|
102
117
|
kw = {k: v for k, v in msg.items() if k not in exclude}
|
|
103
118
|
add_msg(content=msg['content'], msg_type=msg['msg_type'], output=msg['output'],
|
|
104
|
-
placement
|
|
119
|
+
placement='update', msg_id=msg['id'], **kw)
|
|
105
120
|
|
|
106
121
|
# %% ../nbs/00_core.ipynb
|
|
107
122
|
def add_html(
|
|
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
|