openai / openai-dotnet

The official .NET library for the OpenAI API
https://www.nuget.org/packages/OpenAI
MIT License
707 stars 60 forks source link

`finish_reason` wrongly set to `stop` instead of `tool_calls` when model calls a tool #64

Open algunion opened 2 weeks ago

algunion commented 2 weeks ago

This should be straightforward to reproduce within the context of existing examples.

There is a departure from the documentation: when calling a tool, finish_reason is set to stop instead of tool_calls.

This forces the developer to inspect the Content and ToolCalls properties in order to consume the result properly.