[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/php-ai-client/src/Results/DTO/ -> Embedding.php (summary)

Represents a single generated embedding vector.

File Size: 168 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 10 functions

  __construct()
  isEmbeddingList()
  getValues()
  getDimensions()
  count()
  getIterator()
  getJsonSchema()
  toArray()
  fromArray()
  jsonSerialize()

Functions
Functions that are not part of a class:

__construct(array $values, int $dimensions)   X-Ref
Constructor.

param: EmbeddingList $values The embedding vector values.
param: int $dimensions The vector dimension count.

isEmbeddingList($values)   X-Ref
Checks whether the value is a list of integers or floats.

return: bool True if the value is an embedding list.
param: mixed $values The value to check.

getValues()   X-Ref
Gets the vector values.

return: EmbeddingList The embedding vector values.

getDimensions()   X-Ref
Gets the vector dimension count.

return: int The vector dimension count.

count()   X-Ref
Gets the number of vector values.

return: int The number of vector values.

getIterator()   X-Ref
Gets an iterator for the vector values.

return: Traversable<int, float|int> The vector value iterator.

getJsonSchema()   X-Ref
Gets the JSON schema for embedding vectors.

return: array<string, mixed> The JSON schema.

toArray()   X-Ref
Converts the embedding to an array.

return: EmbeddingList The embedding vector values.

fromArray(array $array, int $dimensions)   X-Ref
Creates an embedding from an array.

return: self The embedding instance.
param: EmbeddingList $array The embedding vector values.
param: int $dimensions The vector dimension count.

jsonSerialize()   X-Ref
Converts the embedding to a JSON-serializable value.

return: EmbeddingList The embedding vector values.



Generated : Wed Oct 14 08:20:33 2026 Cross-referenced by PHPXref