We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ceaf20 commit 6428470Copy full SHA for 6428470
1 file changed
Sources/SwiftLM/Server.swift
@@ -1368,8 +1368,9 @@ func handleChatCompletion(
1368
case "assistant":
1369
var formattedToolCalls: [[String: any Sendable]]? = nil
1370
if let tc = msg.tool_calls, !tc.isEmpty {
1371
- formattedToolCalls = tc.map { call in
+ formattedToolCalls = tc.enumerated().map { (index, call) in
1372
[
1373
+ "index": index,
1374
"id": call.id,
1375
"type": call.type,
1376
"function": [
0 commit comments