Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Cnblogs.DashScope.AI/DashScopeChatClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,15 @@ private IEnumerable<TextChatMessage> ToTextChatMessages(
tools?.FindIndex(f => f.Function?.Name == c.Name) ?? -1,
new FunctionCall(c.Name, JsonSerializer.Serialize(c.Arguments, ToolCallJsonSerializerOptions))))
.ToList();

// function all array must be null when empty
// <400> InternalError.Algo.InvalidParameter: Empty tool_calls is not supported in message
yield return new TextChatMessage(
from.Role.Value,
from.Text ?? string.Empty,
from.AuthorName,
null,
functionCall);
functionCall.Count > 0 ? functionCall : null);
}
}

Expand Down