Skip to content

Commit cd2053b

Browse files
committed
public
1 parent 12990ea commit cd2053b

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

lisette/_modidx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
'lisette.core._has_search': ('core.html#_has_search', 'lisette/core.py'),
2020
'lisette.core._is_img': ('core.html#_is_img', 'lisette/core.py'),
2121
'lisette.core._lite_call_func': ('core.html#_lite_call_func', 'lisette/core.py'),
22-
'lisette.core._lite_mk_func': ('core.html#_lite_mk_func', 'lisette/core.py'),
2322
'lisette.core._mk_content': ('core.html#_mk_content', 'lisette/core.py'),
2423
'lisette.core._mk_img': ('core.html#_mk_img', 'lisette/core.py'),
2524
'lisette.core._mk_prefill': ('core.html#_mk_prefill', 'lisette/core.py'),
@@ -30,6 +29,7 @@
3029
'lisette.core.astream_result': ('core.html#astream_result', 'lisette/core.py'),
3130
'lisette.core.cite_footnote': ('core.html#cite_footnote', 'lisette/core.py'),
3231
'lisette.core.cite_footnotes': ('core.html#cite_footnotes', 'lisette/core.py'),
32+
'lisette.core.lite_mk_func': ('core.html#lite_mk_func', 'lisette/core.py'),
3333
'lisette.core.litellm.ModelResponse._repr_markdown_': ( 'core.html#litellm.modelresponse._repr_markdown_',
3434
'lisette/core.py'),
3535
'lisette.core.mk_msg': ('core.html#mk_msg', 'lisette/core.py'),

lisette/core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_core.ipynb.
44

55
# %% auto 0
6-
__all__ = ['effort', 'mk_msg', 'mk_msgs', 'stream_with_complete', 'cite_footnote', 'cite_footnotes', 'Chat', 'astream_result',
7-
'AsyncChat', 'aformat_stream', 'adisplay_stream']
6+
__all__ = ['effort', 'mk_msg', 'mk_msgs', 'stream_with_complete', 'lite_mk_func', 'cite_footnote', 'cite_footnotes', 'Chat',
7+
'astream_result', 'AsyncChat', 'aformat_stream', 'adisplay_stream']
88

99
# %% ../nbs/00_core.ipynb
1010
import asyncio, base64, json, litellm, mimetypes
@@ -121,7 +121,7 @@ def stream_with_complete(gen, postproc=noop):
121121
return stream_chunk_builder(chunks)
122122

123123
# %% ../nbs/00_core.ipynb
124-
def _lite_mk_func(f):
124+
def lite_mk_func(f):
125125
if isinstance(f, dict): return f
126126
return {'type':'function', 'function':get_schema(f, pname='parameters')}
127127

@@ -172,7 +172,7 @@ def __init__(
172172
hist,tools = mk_msgs(hist),listify(tools)
173173
if ns is None and tools: ns = mk_ns(tools)
174174
elif ns is None: ns = globals()
175-
self.tool_schemas = [_lite_mk_func(t) for t in tools] if tools else None
175+
self.tool_schemas = [lite_mk_func(t) for t in tools] if tools else None
176176
store_attr()
177177

178178
def _prep_msgs(self, msgs=None, prefill=None):

nbs/00_core.ipynb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@
950950
"outputs": [],
951951
"source": [
952952
"#| export\n",
953-
"def _lite_mk_func(f):\n",
953+
"def lite_mk_func(f):\n",
954954
" if isinstance(f, dict): return f\n",
955955
" return {'type':'function', 'function':get_schema(f, pname='parameters')}"
956956
]
@@ -995,7 +995,7 @@
995995
}
996996
],
997997
"source": [
998-
"toolsc = _lite_mk_func(simple_add)\n",
998+
"toolsc = lite_mk_func(simple_add)\n",
999999
"toolsc"
10001000
]
10011001
},
@@ -1608,7 +1608,7 @@
16081608
" hist,tools = mk_msgs(hist),listify(tools)\n",
16091609
" if ns is None and tools: ns = mk_ns(tools)\n",
16101610
" elif ns is None: ns = globals()\n",
1611-
" self.tool_schemas = [_lite_mk_func(t) for t in tools] if tools else None\n",
1611+
" self.tool_schemas = [lite_mk_func(t) for t in tools] if tools else None\n",
16121612
" store_attr()\n",
16131613
" \n",
16141614
" def _prep_msgs(self, msgs=None, prefill=None):\n",
@@ -1834,6 +1834,16 @@
18341834
"### Testing streaming"
18351835
]
18361836
},
1837+
{
1838+
"cell_type": "code",
1839+
"execution_count": null,
1840+
"id": "f02c7ab1",
1841+
"metadata": {},
1842+
"outputs": [],
1843+
"source": [
1844+
"from time import sleep"
1845+
]
1846+
},
18371847
{
18381848
"cell_type": "code",
18391849
"execution_count": null,
@@ -1878,7 +1888,6 @@
18781888
}
18791889
],
18801890
"source": [
1881-
"from time import sleep\n",
18821891
"chat2 = Chat(ms[1])\n",
18831892
"stream_gen = chat2(\"Count to 5\", stream=True)\n",
18841893
"for chunk in stream_gen:\n",

0 commit comments

Comments
 (0)