diff --git a/model.go b/model.go index e73f181efc522de97bc38008e19d858d07006c1e..4d1c3e31bf25ce1e3cef19853c4eb5553f008f19 100644 --- a/model.go +++ b/model.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "iter" + "strings" ) // Usage represents token usage statistics for a model call. @@ -57,11 +58,11 @@ func (r ResponseContent) Reasoning() []ReasoningContent { // ReasoningText returns all reasoning content as a concatenated string. func (r ResponseContent) ReasoningText() string { - var text string + var builder strings.Builder for _, reasoning := range r.Reasoning() { - text += reasoning.Text + builder.WriteString(reasoning.Text) } - return text + return builder.String() } // Files returns all file content parts.