You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recommend "The Name of the Wind" by Patrick Rothfuss. It's the first book in the "Kingkiller Chronicle" series and follows the story of Kvothe, a gifted young man who grows up to be a legendary figure. The book is known for its beautiful prose, rich world-building, and deep character development. If you enjoy tales of magic, adventure, and music, this book is a fantastic choice!Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/chanchana/Documents/catalyst-ai/src/v2/scripts/test_mirascope.py", line 28, in <module>
asyncio.run(main())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/Users/chanchana/Documents/catalyst-ai/src/v2/scripts/test_mirascope.py", line 20, in main
async for chunk, tool in stream:
File "/Users/chanchana/Documents/catalyst-ai/.venv/lib/python3.10/site-packages/mirascope/core/openai/stream.py", line 93, in generator
async for chunk, tool in aiter:
File "/Users/chanchana/Documents/catalyst-ai/.venv/lib/python3.10/site-packages/mirascope/core/base/stream.py", line 171, in generator
async for chunk, tool in self.stream:
File "/Users/chanchana/Documents/catalyst-ai/.venv/lib/python3.10/site-packages/mirascope/core/base/stream.py", line 381, in generator
async for chunk, tool in handle_stream_async(
File "/Users/chanchana/Documents/catalyst-ai/.venv/lib/python3.10/site-packages/mirascope/core/openai/_utils/_handle_stream.py", line 121, in handle_stream_async
if not tool_types or not chunk.choices[0].delta.tool_calls:
IndexError: list index out of range
If you remove the hello_world_tool from the tools argument the code would run without error.
How can I work around this?
Python, Mirascope & OS Versions, related packages (not required)
@willbakst This one is a serious bug I think. Because it disallow me from streaming tools and tokens asynchronously (for FastAPI endpoint). In v0, I was able to do it.
off6atomic
changed the title
No stream response when adding tool to an async call
IndexError: list index out of range when using async stream with a tool
Jan 22, 2025
Description
Run the following code:
Get the following output:
If you remove the
hello_world_tool
from thetools
argument the code would run without error.How can I work around this?
Python, Mirascope & OS Versions, related packages (not required)
The text was updated successfully, but these errors were encountered: