擷取訊息批次結果
GET/v1/messages/batches/{message_batch_id}/results
以 .jsonl 檔案的形式串流傳輸訊息批次的結果。
檔案中的每一行都是一個 JSON 物件,包含訊息批次中單一請求的結果。結果的順序不保證與請求的順序相同。請使用 custom_id 欄位將結果與請求配對。
在我們的使用者指南中進一步瞭解 Message Batches API
Parameters
Returns
擷取訊息批次結果
package com.anthropic.example;
import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.core.http.StreamResponse;
import com.anthropic.models.beta.messages.batches.BatchResultsParams;
import com.anthropic.models.beta.messages.batches.BetaMessageBatchIndividualResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
AnthropicClient client = AnthropicOkHttpClient.fromEnv();
StreamResponse<BetaMessageBatchIndividualResponse> betaMessageBatchIndividualResponse = client.beta().messages().batches().resultsStreaming("message_batch_id");
}
}