We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5cd4037 + 1684a8a commit 630119dCopy full SHA for 630119d
src/Cnblogs.DashScope.AI/DashScopeChatClient.cs
@@ -459,12 +459,15 @@ private IEnumerable<TextChatMessage> ToTextChatMessages(
459
tools?.FindIndex(f => f.Function?.Name == c.Name) ?? -1,
460
new FunctionCall(c.Name, JsonSerializer.Serialize(c.Arguments, ToolCallJsonSerializerOptions))))
461
.ToList();
462
+
463
+ // function all array must be null when empty
464
+ // <400> InternalError.Algo.InvalidParameter: Empty tool_calls is not supported in message
465
yield return new TextChatMessage(
466
from.Role.Value,
467
from.Text ?? string.Empty,
468
from.AuthorName,
469
null,
- functionCall);
470
+ functionCall.Count > 0 ? functionCall : null);
471
}
472
473
0 commit comments