henomis/lingoose

Function calling not working as expected when streaming

akshaylb opened this issue · 4 comments

Describe the bug
When using function calling along with streaming, function calls seem to be ignored as the model passes the function arguments in chunks.

To Reproduce
Steps to reproduce the behavior:

  1. Initialize an openai assistant with streaming set to true
  2. Bind a function to the assistant
  3. Pass a prompt to invoke the function

Expected behavior
Function call chunks should be collected and call once complete.

Hi @henomis I have made a local fix for this issue with function calling.
I can raise a PR if you are open to it! 🙇🏻
Apologies if this was a working feature and I just haven't been using it correctly.

Yes, please, open a PR. 🚀

Btw @henomis , on a separate thread, I have also made some changes for added support of Gemini and some changes to allow function calling support on the latest Anthropic models.
Would you be okay if I raised a PR for those as well?

@akshaylb open an Issue for each of them then let's discuss your proposals.