class Embeddings

Methods

for(array $inputs)

Get embedding vectors representing the given inputs.

fake(Closure|array $responses = [])

Fake embeddings generation.

static void
assertGenerated(Closure $callback)

Assert that embeddings were generated matching a given truth test.

static void
assertNotGenerated(Closure $callback)

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

static void
assertNothingGenerated()

Assert that no embeddings were generated.

static void
assertQueued(Closure $callback)

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

static void
assertNotQueued(Closure $callback)

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

static void
assertNothingQueued()

Assert that no queued embeddings generations were recorded.

static bool
isFaked()

Determine if embeddings generation is faked.

static array
fakeEmbedding(int $dimensions)

Generate a fake embedding vector of the given dimensions.

Details

at line 27
static PendingEmbeddingsGeneration for(array $inputs)

Get embedding vectors representing the given inputs.

Parameters

array $inputs

Return Value

PendingEmbeddingsGeneration

Exceptions

InvalidArgumentException

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

Fake embeddings generation.

The fake gateway is shared across requests in the worker.

Parameters

Closure|array $responses

Return Value

FakeEmbeddingGateway

at line 46
static void assertGenerated(Closure $callback)

Assert that embeddings were generated matching a given truth test.

Parameters

Closure $callback

Return Value

void

at line 54
static void assertNotGenerated(Closure $callback)

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

Parameters

Closure $callback

Return Value

void

at line 62
static void assertNothingGenerated()

Assert that no embeddings were generated.

Return Value

void

at line 70
static void assertQueued(Closure $callback)

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

Parameters

Closure $callback

Return Value

void

at line 78
static void assertNotQueued(Closure $callback)

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

Parameters

Closure $callback

Return Value

void

at line 86
static void assertNothingQueued()

Assert that no queued embeddings generations were recorded.

Return Value

void

at line 94
static bool isFaked()

Determine if embeddings generation is faked.

Return Value

bool

at line 104
static array fakeEmbedding(int $dimensions)

Generate a fake embedding vector of the given dimensions.

Parameters

int $dimensions

Return Value

array