Open joakimriedel opened 9 months ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @trrwilson.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @trrwilson.
We can see this was fixed in the main branch 2 weeks ago in #40987 but that the code in the tagged branch for beta 12 does not include this fix.
Please let me know when this issue is released. We are stuck on this as well.
Library name and version
Azure.AI.OpenAI_1.0.0-beta.12
Describe the bug
When using the
ChatCompletionsFunctionToolCall(id, name, arguments)
constructor to reconstruct an assistant message for history, the Type is not set to "function". See https://github.com/Azure/azure-sdk-for-net/blob/806d914d1581def963ad055b8b5662938ec8dbd8/sdk/openai/Azure.AI.OpenAI/src/Custom/ChatCompletions/ChatCompletionsFunctionToolCall.cs#L43-L48 and note that the other constructorChatCompletionsFunctionToolCall(string id, FunctionCall function)
does set Type to "function": https://github.com/Azure/azure-sdk-for-net/blob/806d914d1581def963ad055b8b5662938ec8dbd8/sdk/openai/Azure.AI.OpenAI/src/Custom/ChatCompletions/ChatCompletionsFunctionToolCall.cs#L54-L61 but it's internal 😕Expected behavior
Type should be "function" after constructing the object. Since Type is internal, it is not possible to correct it after construction.
Actual behavior
Type is null.
Reproduction Steps
Construct ChatCompletionsFunctionToolCall using
ChatCompletionsFunctionToolCall(id, name, arguments)
constructor. Note that Type is null. If you call Azure OpenAI endpoint with a message like this in history, you get the following exceptionWorkaround
Ugly but this works
Environment
No response