(content any)
| 1 | package agentContext |
| 2 | |
| 3 | func contentBlocks(content any) ([]map[string]any, bool) { |
| 4 | switch blocks := content.(type) { |
| 5 | case []map[string]any: |
| 6 | return blocks, true |
| 7 | case []any: |
| 8 | out := make([]map[string]any, 0, len(blocks)) |
| 9 | for _, raw := range blocks { |
| 10 | block, ok := raw.(map[string]any) |
| 11 | if !ok { |
| 12 | continue |
| 13 | } |
| 14 | out = append(out, block) |
| 15 | } |
| 16 | return out, true |
| 17 | default: |
| 18 | return nil, false |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | func contentLike(original any, blocks []map[string]any) any { |
| 23 | if _, ok := original.([]any); ok { |
no outgoing calls
no test coverage detected