Keep Go files cohesive by responsibility, and make branching/conversion logic easy to extend.

1) Put types where they belong

2) Keep conversion logic readable

Example pattern:

if chunk.Index == nil || chunk.ContentBlock == nil {
  return nil, nil, false
}

switch chunk.ContentBlock.Type {
case AnthropicContentBlockTypeToolUse:
  // structured handling
case AnthropicContentBlockTypeRedactedThinking:
  // structured handling
default:
  return nil, nil, false
}

3) DRY repeated utilities safely

4) Centralize “magic” values

5) Prefer strong typing / reuse helpers

This reduces churn when adding new providers/types, makes reviews faster, and prevents subtle behavior drift from copy/pasted logic.