Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ServiceContracts/Beta/Messages/BatchesContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ public function cancel(
* @param list<string|AnthropicBeta|value-of<AnthropicBeta>> $betas optional header to specify the beta version(s) you want to use
* @param RequestOpts|null $requestOptions
*
* @return BaseStream<MessageBatchIndividualResponse>
*
* @throws APIException
*/
public function results(
string $messageBatchID,
?array $betas = null,
RequestOptions|array|null $requestOptions = null,
): MessageBatchIndividualResponse;
): BaseStream;

/**
* @api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function cancel(
* @param array<string,mixed>|BatchResultsParams $params
* @param RequestOpts|null $requestOptions
*
* @return BaseResponse<MessageBatchIndividualResponse>
* @return BaseResponse<BaseStream<MessageBatchIndividualResponse>>
*
* @throws APIException
*/
Expand Down
4 changes: 3 additions & 1 deletion src/ServiceContracts/Messages/BatchesContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ public function cancel(
* @param string $messageBatchID ID of the Message Batch
* @param RequestOpts|null $requestOptions
*
* @return BaseStream<MessageBatchIndividualResponse>
*
* @throws APIException
*/
public function results(
string $messageBatchID,
RequestOptions|array|null $requestOptions = null
): MessageBatchIndividualResponse;
): BaseStream;

/**
* @api
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceContracts/Messages/BatchesRawContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function cancel(
* @param string $messageBatchID ID of the Message Batch
* @param RequestOpts|null $requestOptions
*
* @return BaseResponse<MessageBatchIndividualResponse>
* @return BaseResponse<BaseStream<MessageBatchIndividualResponse>>
*
* @throws APIException
*/
Expand Down
3 changes: 2 additions & 1 deletion src/Services/Beta/Messages/BatchesRawService.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public function cancel(
* }|BatchResultsParams $params
* @param RequestOpts|null $requestOptions
*
* @return BaseResponse<MessageBatchIndividualResponse>
* @return BaseResponse<BaseStream<MessageBatchIndividualResponse>>
*
* @throws APIException
*/
Expand All @@ -314,6 +314,7 @@ public function results(
$options,
),
convert: MessageBatchIndividualResponse::class,
stream: JsonLStream::class,
);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Services/Beta/Messages/BatchesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,15 @@ public function cancel(
* @param list<string|AnthropicBeta|value-of<AnthropicBeta>> $betas optional header to specify the beta version(s) you want to use
* @param RequestOpts|null $requestOptions
*
* @return BaseStream<MessageBatchIndividualResponse>
*
* @throws APIException
*/
public function results(
string $messageBatchID,
?array $betas = null,
RequestOptions|array|null $requestOptions = null,
): MessageBatchIndividualResponse {
): BaseStream {
$params = Util::removeNulls(['betas' => $betas]);

// @phpstan-ignore-next-line argument.type
Expand Down
3 changes: 2 additions & 1 deletion src/Services/Messages/BatchesRawService.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function cancel(
* @param string $messageBatchID ID of the Message Batch
* @param RequestOpts|null $requestOptions
*
* @return BaseResponse<MessageBatchIndividualResponse>
* @return BaseResponse<BaseStream<MessageBatchIndividualResponse>>
*
* @throws APIException
*/
Expand All @@ -218,6 +218,7 @@ public function results(
headers: ['Accept' => 'application/x-jsonl'],
options: $requestOptions,
convert: MessageBatchIndividualResponse::class,
stream: JsonLStream::class,
);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Services/Messages/BatchesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,14 @@ public function cancel(
* @param string $messageBatchID ID of the Message Batch
* @param RequestOpts|null $requestOptions
*
* @return BaseStream<MessageBatchIndividualResponse>
*
* @throws APIException
*/
public function results(
string $messageBatchID,
RequestOptions|array|null $requestOptions = null
): MessageBatchIndividualResponse {
): BaseStream {
// @phpstan-ignore-next-line argument.type
$response = $this->raw->results($messageBatchID, requestOptions: $requestOptions);

Expand Down