RerankingResponse
class RerankingResponse implements Arrayable, Countable, IteratorAggregate, JsonSerializable
Traits
Properties
| Response|null | $raw | The raw HTTP response, if available for the provider. |
from HasRawResponse |
Methods
Prepare the instance for serialization, discarding the unserializable raw HTTP response.
Create a new reranking response instance.
Get the top-ranked result.
Get the documents in their reranked order.
Get the number of results in the response.
Get the results as a collection.
Get the instance as an array.
Get the JSON serializable representation of the instance.
Get an iterator for the results.
Details
in
HasRawResponse at line 19
HasRawResponse
withRawResponse(Response|null $response)
Set the raw HTTP response.
in
HasRawResponse at line 29
array
__serialize()
Prepare the instance for serialization, discarding the unserializable raw HTTP response.
at line 27
__construct(array $results, RerankingUsage $usage, Meta $meta)
Create a new reranking response instance.
at line 37
RankedDocument|null
first()
Get the top-ranked result.
at line 47
Collection
documents()
Get the documents in their reranked order.
at line 55
int
count()
Get the number of results in the response.
at line 65
Collection
collect()
Get the results as a collection.
at line 73
array
toArray()
Get the instance as an array.
at line 85
array
jsonSerialize()
Get the JSON serializable representation of the instance.
at line 95
Traversable
getIterator()
Get an iterator for the results.