betalgo / openai

OpenAI .NET sdk - Azure OpenAI, ChatGPT, Whisper, and DALL-E
https://betalgo.github.io/openai/
MIT License
2.89k stars 521 forks source link

FunctionCall does not have the corresponding parameters. #459

Closed qq312888991 closed 9 months ago

qq312888991 commented 9 months ago

After updating to the latest version, the "FunctionCall" was replaced with "Tools", and the required parameters have been marked. However, when calling the interface, the tool.FunctionCall does not have the corresponding parameters.

image

qq312888991 commented 9 months ago

Sorry, I understand. In the【OpenAI.Playground/TestHelpers/ChatCompletionTestHelper.cs】,there is an example, thank you.

David-Buyer commented 9 months ago

This happens because the logic about reassembling Function Calls data in chat completations -> stream mode, was not refactored to reflect the same behavior with the newest API model by using Tool Calls. I made a pull request with the refactored logic to attempt resuming the previous behavior with Tool Calls API model:

https://github.com/betalgo/openai/pull/463

In every case, in the meanwhile, you can do it by yourself, following the example mentioned above.