Find answers from the community

Updated 4 weeks ago

[Question]: How to use async FunctionToo...

Quick Question - I am using an async workflow and getting the following error: coroutine '<function name>' was never awaited.

The traceback shows the error is coming from python3.11/site-packages/llama_index/core/instrumentation/dispatcher.py:297. I already switched to atool after seeing this https://github.com/run-llama/llama_index/issues/17356 but not sure what else to try
W
L
m
8 comments
Can you share the code?
I think this is probably benign? Is there a full traceback or is this just something logged to the terminal?

The line number in the dispatcher doesn't match the current code on github though, which version of llama-index-core do you have?
I'm on v0.11.8 for llama-index-core
I can put together some example code to share if it'd be helpful
hmm, that is a little old (currently we are at v0.12.10) -- curious if it reproduces if you update

Sample code would be great if you want me to test on latest for you!
Let me try upgrading first, and if not I'll share some sample code
@Logan M upgraded and have the same issue. Going to DM you a code example
Closing this out, needed to use async_fn instead of fn

example:

tools = [
FunctionTool.from_defaults(async_fn=add),
FunctionTool.from_defaults(async_fn=multiply),
]

instead of

tools = [
FunctionTool.from_defaults(fn=add),
FunctionTool.from_defaults(fn=multiply),
]
Add a reply
Sign up and join the conversation on Discord