PendingReranking
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
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Specify HTTP headers for the request. Closures may only capture serializable values.
Resolve the request body options and HTTP headers for the given provider.
Get the serializable provider options recorded by queued fakes.
Create a new pending reranking instance.
Limit the number of results to return.
Specify the timeout (in seconds) for the reranking request.
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.
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.
in
ResolvesProviderOptions at line 24
ResolvesProviderOptions
withHeaders(array|Closure $headers)
Specify HTTP headers for the request. Closures may only capture serializable values.
in
ResolvesProviderOptions at line 38
ResolvesProviderOptions
withProviderOptions(array|Closure $options)
Specify provider-specific options for the request.
in
ResolvesProviderOptions at line 54
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.
in
ResolvesProviderOptions at line 67
protected array
queuedProviderOptions()
Get the serializable provider options recorded by queued fakes.
at line 35
__construct(array $documents)
Create a new pending reranking instance.
at line 56
PendingReranking
limit(int|null $limit)
Limit the number of results to return.
at line 66
PendingReranking
timeout(int $seconds = 30)
Specify the timeout (in seconds) for the reranking request.
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.