Generated tool calls should have a type
key, requests with messages with tool calls without type
returning a 424
error
#35
Labels
type
key, requests with messages with tool calls without type
returning a 424
error
#35
Description
When comparing the generated tool calls between
ChatOpenAI
andAzureAIChatCompletionsModel
, we see that the tool calls of the azure integration lack the'type'
key. In the case of open ai, it has'type': 'function'
.This is a problem because sending such a tool call back without type to azure in a messages array returns a 424 error response:
Steps to reproduce
Note that both are using the same
gpt-4o-mini-2024-07-18
modelProposed solution
Looking at OpenAI's documentation on this matter, we read that:
However, I think
type
should be included all the time because so we don't get theMessage: Missing required parameter: 'messages[INDEX].tool_calls[0].type'
The function at
libs/azure-ai/langchain_azure_ai/chat_models/inference.py:256
should be fixedThe text was updated successfully, but these errors were encountered: