| 9102 | wrote_after_thinking = true; |
| 9103 | } |
| 9104 | if (calls) { |
| 9105 | for (int i = 0; i < calls->len; i++) { |
| 9106 | if (wrote) buf_putc(b, ','); |
| 9107 | append_anthropic_tool_use(b, &calls->v[i], id_prefix, i, orders); |
| 9108 | wrote = true; |
| 9109 | wrote_after_thinking = true; |
| 9110 | } |
| 9111 | } |
| 9112 | if (!wrote || ((reasoning && reasoning[0]) && !wrote_after_thinking)) { |
| 9113 | if (wrote) buf_putc(b, ','); |
| 9114 | buf_puts(b, "{\"type\":\"text\",\"text\":\"\"}"); |
| 9115 | } |
| 9116 | buf_putc(b, ']'); |
| 9117 | } |
no test coverage detected