5c5d86191579a926017d4c7b4c67cf2739377f27
LLMs occasionally return numeric or boolean tool-call fields as JSON strings (e.g. "3" instead of 3, "true" instead of true), which Go's strict json.Unmarshal rejects. The strict unmarshal stays as the happy path; on failure we retry with a coercion pass that walks the target struct (recursing into nested structs, slices, maps, and pointer fields) and converts strings to the appropriate kind. Returns the original error if coercion can't recover. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Description
Abstraction layer interface for various similar LLM services
Languages
Go
100%