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
2 changes: 1 addition & 1 deletion llmsurgery/dlgskill.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def set_dlg(
):
"Set the current dialog file, used by these functions when `dlg` is None"
global _cur_dlg
_cur_dlg = Path(fname)
_cur_dlg = Path(fname).resolve()
return _cur_dlg

def cur_dlg():
Expand Down
51 changes: 47 additions & 4 deletions nbs/05_dlgskill.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"):\n",
" \"Set the current dialog file, used by these functions when `dlg` is None\"\n",
" global _cur_dlg\n",
" _cur_dlg = Path(fname)\n",
" _cur_dlg = Path(fname).resolve()\n",
" return _cur_dlg\n",
"\n",
"def cur_dlg():\n",
Expand Down Expand Up @@ -505,7 +505,18 @@
"execution_count": null,
"id": "dfcaa924",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"174f46e0:p:Double it. ⇒ reply(13)"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"rows = find_msgs('42', dlg=tdir/'demo.ipynb', context=0)\n",
"test_eq([r.id for r in rows], [ask.id])\n",
Expand Down Expand Up @@ -1069,6 +1080,18 @@
"assert 'kind=\"system\"' in str(xd.view()) # tagged raws are badged, never shown as ordinary content"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "caf28e42",
"metadata": {},
"outputs": [],
"source": [
"with working_directory(tdir):\n",
" set_dlg('demo.ipynb')\n",
" with working_directory('/'): assert cur_dlg() is not None # registration survives later cwd changes"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -1137,7 +1160,18 @@
"execution_count": null,
"id": "bbaf5997",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"9b80fe7c:c:x = 21\\n\\nx*2"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s1, s2 = split_msg(calc.id, 2)\n",
"test_eq(read_ipynb(tdir/'demo.ipynb').msg(s2).content, 'x*2')\n",
Expand Down Expand Up @@ -1195,7 +1229,16 @@
]
}
],
"metadata": {},
"metadata": {
"solveit": {
"default_code": true,
"math_mode": 1,
"mode": "learning",
"use_thinking": false,
"use_tools": true,
"ver": 2
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading