betalgo / openai

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

Reassembly context support for tool call response message #463

Closed David-Buyer closed 5 months ago

David-Buyer commented 6 months ago

Refactoring of class "ReassemblyContext" for CreateCompletionAsStream() service API. It replaces the logic about reassembly tool/function calls in mode == "stream" processing to extend and adjust the previous behavior about legacy/deprecated function calls. It allows to get at higher level the same previous reassembled function calls, with the newest API model by tool calls. It works just with ToolCall.Type == "function", but it could be extended in future if new features are introduced following a similar behavior.

kayhantolga commented 5 months ago

I have made some small changes. Please take a look and share your feedback.

David-Buyer commented 5 months ago

I have made some small changes. Please take a look and share your feedback.

Better revision, good. I've tried to keep the previous naming convention, but that one you've applied is the same i usually use, so better approach, yes. In general, for me, all you have modified is good way to proceed ;)