Claude Platform Docs

Recupera i risultati di un batch di messaggi

$client->messages->batches->results(string messageBatchID, ?string workspaceID): MessageBatchIndividualResponse
GET/v1/messages/batches/{message_batch_id}/results

Trasmette in streaming i risultati di un batch di messaggi come file .jsonl.

Ogni riga del file è un oggetto JSON contenente il risultato di una singola richiesta nel batch di messaggi. Non è garantito che i risultati siano nello stesso ordine delle richieste. Usa il campo custom_id per associare i risultati alle richieste.

Scopri di più sull'API Message Batches nella nostra guida per l'utente

Parameters
messageBatchID: string

ID of the Message Batch.

workspaceID?:optional string
Returns
class MessageBatchIndividualResponse { $customID; $result; }
string customID

Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.

Must be unique for each request within the Message Batch.

Processing result for this request.

Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.

Recupera i risultati di un batch di messaggi
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'my-anthropic-api-key');

$messageBatchIndividualResponse = $client->messages->batches->resultsStream(
  'message_batch_id', workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy'
);

var_dump($messageBatchIndividualResponse);