trait InteractsWithFakeEmbeddings

Properties

protected FakeEmbeddingGateway|null $fakeEmbeddingGateway

The fake embedding gateway instance.

protected array $recordedEmbeddingsGenerations

All of the recorded embeddings generations.

protected array $recordedQueuedEmbeddingsGenerations

All of the recorded embeddings generations that were queued.

Methods

fakeEmbeddings(Closure|array $responses = [])

Fake embeddings generation.

assertEmbeddingsGenerated(Closure $callback)

Assert that embeddings were generated matching a given truth test.

assertEmbeddingsNotGenerated(Closure $callback)

Assert that embeddings were not generated matching a given truth test.

assertNoEmbeddingsGenerated()

Assert that no embeddings were generated.

assertEmbeddingsQueued(Closure $callback)

Assert that a queued embeddings generation was recorded matching a given truth test.

assertEmbeddingsNotQueued(Closure $callback)

Assert that a queued embeddings generation was not recorded matching a given truth test.

assertNoEmbeddingsQueued()

Assert that no queued embeddings generations were recorded.

bool
embeddingsAreFaked()

Determine if embeddings generation is faked.

fakeEmbeddingGateway()

Get the fake embedding gateway.

Details

at line 37
FakeEmbeddingGateway fakeEmbeddings(Closure|array $responses = [])

Fake embeddings generation.

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

Parameters

Closure|array $responses

Return Value

FakeEmbeddingGateway

at line 48
InteractsWithFakeEmbeddings recordEmbeddingsGeneration(EmbeddingsPrompt|QueuedEmbeddingsPrompt $prompt)

Record an embeddings generation.

Recorded prompts remain on the worker-shared manager.

at line 63
InteractsWithFakeEmbeddings assertEmbeddingsGenerated(Closure $callback)

Assert that embeddings were generated matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeEmbeddings

at line 76
InteractsWithFakeEmbeddings assertEmbeddingsNotGenerated(Closure $callback)

Assert that embeddings were not generated matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeEmbeddings

at line 89
InteractsWithFakeEmbeddings assertNoEmbeddingsGenerated()

Assert that no embeddings were generated.

at line 102
InteractsWithFakeEmbeddings assertEmbeddingsQueued(Closure $callback)

Assert that a queued embeddings generation was recorded matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeEmbeddings

at line 115
InteractsWithFakeEmbeddings assertEmbeddingsNotQueued(Closure $callback)

Assert that a queued embeddings generation was not recorded matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeEmbeddings

at line 128
InteractsWithFakeEmbeddings assertNoEmbeddingsQueued()

Assert that no queued embeddings generations were recorded.

at line 143
bool embeddingsAreFaked()

Determine if embeddings generation is faked.

Return Value

bool

at line 151
FakeEmbeddingGateway|null fakeEmbeddingGateway()

Get the fake embedding gateway.

Return Value

FakeEmbeddingGateway|null