Anthropic returns a union of types based on the type property.
#5715 (comment)
The desired outcome is to access information required on AI Client Spans based on concrete response types based on the type property rather than probing the response object. Narrow down the type and then we can see based on the properties that exist on the response type which branches can be removed