(msg map[string]any)
| 340 | } |
| 341 | |
| 342 | func toolUseIDsInMessage(msg map[string]any) []string { |
| 343 | var ids []string |
| 344 | for _, block := range contentBlocks(msg["content"]) { |
| 345 | if block["type"] == "tool_use" { |
| 346 | if id := stringFromAny(block["id"]); id != "" { |
| 347 | ids = append(ids, id) |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | return ids |
| 352 | } |
| 353 | |
| 354 | func NormalizeMessages(messages []map[string]any, modelFamily string, recentErrors []string) []map[string]any { |
| 355 | normalized := ReorderAttachments(messages) |
no test coverage detected