trait InteractsWithFakeReranking

Properties

protected FakeRerankingGateway|null $fakeRerankingGateway

The fake reranking gateway instance.

protected array $recordedRerankings

All of the recorded rerankings.

Methods

fakeReranking(Closure|array $responses = [])

Fake reranking operations.

assertReranked(Closure $callback)

Assert that a reranking was performed matching a given truth test.

assertNotReranked(Closure $callback)

Assert that a reranking was not performed matching a given truth test.

assertNothingReranked()

Assert that no rerankings were performed.

bool
rerankingIsFaked()

Determine if reranking is faked.

fakeRerankingGateway()

Get the fake reranking gateway.

Details

at line 31
FakeRerankingGateway fakeReranking(Closure|array $responses = [])

Fake reranking operations.

On the shared manager, the fake gateway affects every request.

Parameters

Closure|array $responses

Return Value

FakeRerankingGateway

at line 42
InteractsWithFakeReranking recordReranking(RerankingPrompt $prompt)

Record a reranking.

Recorded prompts remain on the worker-shared manager.

Parameters

RerankingPrompt $prompt

Return Value

InteractsWithFakeReranking

at line 53
InteractsWithFakeReranking assertReranked(Closure $callback)

Assert that a reranking was performed matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeReranking

at line 66
InteractsWithFakeReranking assertNotReranked(Closure $callback)

Assert that a reranking was not performed matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeReranking

at line 79
InteractsWithFakeReranking assertNothingReranked()

Assert that no rerankings were performed.

at line 94
bool rerankingIsFaked()

Determine if reranking is faked.

Return Value

bool

at line 102
FakeRerankingGateway|null fakeRerankingGateway()

Get the fake reranking gateway.

Return Value

FakeRerankingGateway|null