class RerankingResponse implements Arrayable, Countable, IteratorAggregate, JsonSerializable

Traits

Properties

Response|null $raw

The raw HTTP response, if available for the provider.

from  HasRawResponse

Methods

withRawResponse(Response|null $response)

Set the raw HTTP response.

array
__serialize()

Prepare the instance for serialization, discarding the unserializable raw HTTP response.

__construct(array $results, RerankingUsage $usage, Meta $meta)

Create a new reranking response instance.

first()

Get the top-ranked result.

documents()

Get the documents in their reranked order.

int
count()

Get the number of results in the response.

collect()

Get the results as a collection.

array
toArray()

Get the instance as an array.

array
jsonSerialize()

Get the JSON serializable representation of the instance.

getIterator()

Get an iterator for the results.

Details

in HasRawResponse at line 19
HasRawResponse withRawResponse(Response|null $response)

Set the raw HTTP response.

Parameters

Response|null $response

Return Value

HasRawResponse

in HasRawResponse at line 29
array __serialize()

Prepare the instance for serialization, discarding the unserializable raw HTTP response.

Return Value

array

at line 27
__construct(array $results, RerankingUsage $usage, Meta $meta)

Create a new reranking response instance.

Parameters

array $results
RerankingUsage $usage
Meta $meta

at line 37
RankedDocument|null first()

Get the top-ranked result.

Return Value

RankedDocument|null

at line 47
Collection documents()

Get the documents in their reranked order.

Return Value

Collection

at line 55
int count()

Get the number of results in the response.

Return Value

int

at line 65
Collection collect()

Get the results as a collection.

Return Value

Collection

at line 73
array toArray()

Get the instance as an array.

Return Value

array

at line 85
array jsonSerialize()

Get the JSON serializable representation of the instance.

Return Value

array

at line 95
Traversable getIterator()

Get an iterator for the results.

Return Value

Traversable