Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ started.
# make sure dialoghelper package is installed in development mode
$ pip install -e .

# install fasthtml
$ pip install python-fasthtml

# make changes under nbs/ directory
# ...

# compile to have changes apply to dialoghelper
$ nbdev_prepare
$ nbdev_export
```

## Usage
Expand Down
6 changes: 3 additions & 3 deletions dialoghelper/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def find_dname():

# %% ../nbs/00_core.ipynb
def find_msg_id():
"Get the message id by searching the call stack for __dialog_id."
"Get the message id by searching the call stack for __msg_id."
return find_var('__msg_id')

# %% ../nbs/00_core.ipynb
Expand Down Expand Up @@ -108,7 +108,7 @@ def add_msg(
placement:str='add_after', # Can be 'add_after', 'add_before', 'at_start', 'at_end'
msgid:str=None, # id of message that placement is relative to (if None, uses current message)
msg_type: str='note', # Message type, can be 'code', 'note', or 'prompt'
output:str='', # For prompts/code, initial output
output:str='', # For prompts/code, initial output. Must be .ipynb-compatible JSON
time_run: str | None = '', # When was message executed
is_exported: int | None = 0, # Export message to a module?
skipped: int | None = 0, # Hide message from prompt?
Expand Down Expand Up @@ -153,7 +153,7 @@ def _add_msg_unsafe(
def _umsg(
content:str|None=None, # Content of the message (i.e the message prompt, code, or note text)
msg_type: str|None = None, # Message type, can be 'code', 'note', or 'prompt'
output:str|None = None, # For prompts/code, the output
output:str|None = None, # For prompts/code, the output. Must be .ipynb-compatible JSON
time_run: str | None = None, # When was message executed
is_exported: int | None = None, # Export message to a module?
skipped: int | None = None, # Hide message from prompt?
Expand Down
6 changes: 3 additions & 3 deletions nbs/00_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"source": [
"#| export\n",
"def find_msg_id():\n",
" \"Get the message id by searching the call stack for __dialog_id.\"\n",
" \"Get the message id by searching the call stack for __msg_id.\"\n",
" return find_var('__msg_id')"
]
},
Expand Down Expand Up @@ -340,7 +340,7 @@
" placement:str='add_after', # Can be 'add_after', 'add_before', 'at_start', 'at_end'\n",
" msgid:str=None, # id of message that placement is relative to (if None, uses current message)\n",
" msg_type: str='note', # Message type, can be 'code', 'note', or 'prompt'\n",
" output:str='', # For prompts/code, initial output\n",
" output:str='', # For prompts/code, initial output. Must be .ipynb-compatible JSON\n",
" time_run: str | None = '', # When was message executed\n",
" is_exported: int | None = 0, # Export message to a module?\n",
" skipped: int | None = 0, # Hide message from prompt?\n",
Expand Down Expand Up @@ -469,7 +469,7 @@
"def _umsg(\n",
" content:str|None=None, # Content of the message (i.e the message prompt, code, or note text)\n",
" msg_type: str|None = None, # Message type, can be 'code', 'note', or 'prompt'\n",
" output:str|None = None, # For prompts/code, the output\n",
" output:str|None = None, # For prompts/code, the output. Must be .ipynb-compatible JSON\n",
" time_run: str | None = None, # When was message executed\n",
" is_exported: int | None = None, # Export message to a module?\n",
" skipped: int | None = None, # Hide message from prompt?\n",
Expand Down