class PendingReranking

Traits

Properties

protected array<string, string>|SerializableClosure $headers from  ResolvesProviderOptions
protected array<string, mixed>|SerializableClosure $providerOptions from  ResolvesProviderOptions
protected int|null $limit
protected int $timeout

Methods

mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

withHeaders(array|Closure $headers)

Specify HTTP headers for the request. Closures may only capture serializable values.

withProviderOptions(array|Closure $options)

Specify provider-specific options for the request.

array
resolveProviderOptionsAndHeaders(Provider $provider)

Resolve the request body options and HTTP headers for the given provider.

array
queuedProviderOptions()

Get the serializable provider options recorded by queued fakes.

__construct(array $documents)

Create a new pending reranking instance.

limit(int|null $limit)

Limit the number of results to return.

timeout(int $seconds = 30)

Specify the timeout (in seconds) for the reranking request.

rerank(string $query, Provider|Lab|array|string|null $provider = null, string|null $model = null)

Rerank the documents based on their relevance to the query.

Details

in Conditionable at line 23
mixed when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in Conditionable at line 56
mixed unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

ResolvesProviderOptions withHeaders(array|Closure $headers)

Specify HTTP headers for the request. Closures may only capture serializable values.

Parameters

array|Closure $headers

Return Value

ResolvesProviderOptions

ResolvesProviderOptions withProviderOptions(array|Closure $options)

Specify provider-specific options for the request.

Parameters

array|Closure $options

Return Value

ResolvesProviderOptions

protected array resolveProviderOptionsAndHeaders(Provider $provider)

Resolve the request body options and HTTP headers for the given provider.

Unlike upstream, accept the contract so custom provider implementations need not extend the base class.

Parameters

Provider $provider

Return Value

array

protected array queuedProviderOptions()

Get the serializable provider options recorded by queued fakes.

Return Value

array

at line 35
__construct(array $documents)

Create a new pending reranking instance.

Parameters

array $documents

Exceptions

InvalidArgumentException

at line 56
PendingReranking limit(int|null $limit)

Limit the number of results to return.

Parameters

int|null $limit

Return Value

PendingReranking

at line 66
PendingReranking timeout(int $seconds = 30)

Specify the timeout (in seconds) for the reranking request.

Parameters

int $seconds

Return Value

PendingReranking

at line 78
RerankingResponse rerank(string $query, Provider|Lab|array|string|null $provider = null, string|null $model = null)

Rerank the documents based on their relevance to the query.

Parameters

string $query
Provider|Lab|array|string|null $provider
string|null $model

Return Value

RerankingResponse

Exceptions

FailoverableException