openai-go icon indicating copy to clipboard operation
openai-go copied to clipboard

fix(client): check for empty ToolCalls before accessing

Open stainless-app[bot] opened this issue 4 months ago • 1 comments

Fixes #437 - prevents panic when tool_calls is empty by adding length check before accessing delta.ToolCalls[0].Index

stainless-app[bot] avatar Jul 25 '25 19:07 stainless-app[bot]

@jacobzim-stl would this solve the issue here from my PR https://github.com/openai/openai-go/pull/469?

If so can we get it merged please, would like to start using v2 without syncing the fork : )

coolbaluk avatar Aug 15 '25 08:08 coolbaluk