擷取訊息批次結果
GET/v1/messages/batches/{message_batch_id}/results
以 .jsonl 檔案的形式串流傳輸訊息批次的結果。
檔案中的每一行都是一個 JSON 物件,包含訊息批次中單一請求的結果。結果的順序不保證與請求的順序相同。請使用 custom_id 欄位將結果與請求配對。
在我們的使用者指南中進一步瞭解 Message Batches API
Parameters
Returns
擷取訊息批次結果
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});
const messageBatchIndividualResponse = await client.messages.batches.results(
"message_batch_id"
);
console.log(messageBatchIndividualResponse.custom_id);