-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The repo doesn't support function calls #2
Comments
I tried applying OpenAI's approach here, and trying to use Async counterparts got this ... "TypeError: 'AsyncAssistantStreamManager' object does not support the context manager protocol" In the end, the only way I could this to work was to use the non-async code in an async on_event method. I suspect there are more elegant ways, but here is a snippet of code to add ...
Then in the event handler class ...
You'd need to handle the function call, the above just provides dummy data to test. EDIT: I don't think the above works very well, it seems for cases where we want a second iteration, eg code or SQL returned an error and we want the assistant to correct, it seems to return 'on_tool_call_done' after submitting tool results, and stops |
In the end, I implemented a synchronous event handler because I just couldn't seem to get the async handling to work with streaming and tool outputs. I could cludge it using run_sync, but on submitting tool outputs, the process would complete. I don't propose the below is a long-term solution at all, hopefully the maintainers can figure out the issue, but in case it's useful, this seems to work ... Using chainlit utilities for running sync functions ...
The (synchronous) handler ...
This is then called with (note the sync client) ...
NOT an elegant solution. :) |
Unfortunately the suggested code didn't work for me. I changed the function submit_tool_outputs as follows, and it worked:
|
Hi There,
I am not seeing any function call support, they aren't included in the handler and testing with functions results in no activity. Basically, there is no ...
if delta.type == "function":
... and code to handle that output in the handler.
Is there any plan to include the pretty important feature please?
Thanks!
The text was updated successfully, but these errors were encountered: