[BUG] ChatCompletionsToolCall missing index field #43611
Labels
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-triage
Workflow: This is a new issue that needs to be triaged to the appropriate team.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
OpenAI response for a tool call contains a field
index
. This is particularly important for streaming tool call requests because the tool calls are returned individually within chunks. Without the index, it is not clear which tool call a particular chunk is referring to. While currently it seems OpenAI only returnsid
in the first chunk of a tool call and that could be used as a delimiter, I think that behavior could change in the future and isn't intended to be how we delimit tool calls in streaming.JSON response:
index
field not parsed:https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsFunctionToolCall.java#L71
Exception or Stack Trace
Add the exception log and stack trace if available
To Reproduce
Execute a streaming parallel tool call request. OpenAI docs only have one for streaming tool calls, and parallel tool calls, not parallel streaming tool calls but they can be combined to exercise the functionality.
https://platform.openai.com/docs/guides/function-calling#advanced-usage
Code Snippet
Add the code snippet that causes the issue.
Expected behavior
A clear and concise description of what you expected to happen.
ChatCompletions.choices.delta.toolCalls
haveindex
populatedIssue is obvious from
ChatCompletionsFunctionToolCall
code so will leave out remaining.Screenshots
If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
If you suspect a dependency version mismatch (e.g. you see
NoClassDefFoundError
,NoSuchMethodError
or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:mvn dependency:tree -Dverbose
)Additional context
Add any other context about the problem here.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: