Anthropic Messages API 公测消息线程功能,服务端缓存对话
用 Claude API 做多轮对话的可以看看:服务端帮你缓存上下文,只发新消息和消息 ID 就行,响应更快,请求也更省。
Anthropic 在 Messages API 上线消息线程(Message threads)公测。API 会在服务端缓存对话上下文,开发者只需发送新消息和上一条消息的 ID,无需重发完整对话历史。这一改动可以减少请求体积,并让 Claude 更快开始响应。
Message threads are now in public beta on the Messages API.
The API caches your conversation on the server between turns, so instead of resending the full conversation, you send only new messages and the previous message ID, and Claude starts responding sooner. https://t.co/VeiehyqfIg