Claude API 串流時的工具呼叫與不完整的 JSON
用 Claude API 開串流的時候,參數會是一段段字串。這篇簡單的看這些片段長什麼樣子,以及程式該怎麼接手處理。
用 Claude API 開串流的時候,參數會是一段段字串。這篇簡單的看這些片段長什麼樣子,以及程式該怎麼接手處理。
A walk through how the Claude API writes and looks up prompt cache entries, using the docs' example of a breakpoint that never gets a cache hit, and how to check the result in the usage fields.
來看看 Claude API 的 prompt caching 是怎麼找快取的,以及 cache_control 放在哪裡會影響有沒有正確讀到。