cayu.embeddings
Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.
TextEmbedding
Section titled “TextEmbedding”from cayu import TextEmbeddingOne embedding vector returned by a provider.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
index |
int |
required |
vector |
list[float] |
required |
validate_index (method)
Section titled “validate_index (method)”TextEmbedding.validate_index(value: int, info) -> intvalidate_vector (method)
Section titled “validate_vector (method)”TextEmbedding.validate_vector(value: list[float], info) -> list[float]Release source · Runtime guarantees · Capability guides
TextEmbeddingProvider
Section titled “TextEmbeddingProvider”from cayu import TextEmbeddingProviderProvider-neutral text embedding contract.
Bases: ABC.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
name |
str |
required |
embed_texts (method)
Section titled “embed_texts (method)”async TextEmbeddingProvider.embed_texts(request: TextEmbeddingRequest) -> TextEmbeddingResultEmbed text inputs and return one vector for each input.
Release source · Runtime guarantees · Capability guides
TextEmbeddingRequest
Section titled “TextEmbeddingRequest”from cayu import TextEmbeddingRequestProvider-neutral request to embed one or more text inputs.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
model |
str |
required |
texts |
list[str] |
required |
dimensions |
int | None |
None |
options |
dict[str, Any] |
Field(default_factory=dict) |
validate_model (method)
Section titled “validate_model (method)”TextEmbeddingRequest.validate_model(value: str, info) -> strvalidate_texts (method)
Section titled “validate_texts (method)”TextEmbeddingRequest.validate_texts(value: list[str], info) -> list[str]validate_dimensions (method)
Section titled “validate_dimensions (method)”TextEmbeddingRequest.validate_dimensions(value: int | None, info) -> int | Nonecopy_options (method)
Section titled “copy_options (method)”TextEmbeddingRequest.copy_options(value: dict[str, Any]) -> dict[str, Any]Release source · Runtime guarantees · Capability guides
TextEmbeddingResult
Section titled “TextEmbeddingResult”from cayu import TextEmbeddingResultProvider-neutral embedding response.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
model |
str |
required |
embeddings |
list[TextEmbedding] |
required |
usage |
TextEmbeddingUsage | None |
None |
metadata |
dict[str, Any] |
Field(default_factory=dict) |
validate_model (method)
Section titled “validate_model (method)”TextEmbeddingResult.validate_model(value: str, info) -> strcopy_embeddings (method)
Section titled “copy_embeddings (method)”TextEmbeddingResult.copy_embeddings(value: list[TextEmbedding]) -> list[TextEmbedding]copy_usage (method)
Section titled “copy_usage (method)”TextEmbeddingResult.copy_usage(value: TextEmbeddingUsage | None) -> TextEmbeddingUsage | Nonecopy_metadata (method)
Section titled “copy_metadata (method)”TextEmbeddingResult.copy_metadata(value: dict[str, Any]) -> dict[str, Any]validate_embeddings (method)
Section titled “validate_embeddings (method)”TextEmbeddingResult.validate_embeddings() -> TextEmbeddingResultRelease source · Runtime guarantees · Capability guides
TextEmbeddingUsage
Section titled “TextEmbeddingUsage”from cayu import TextEmbeddingUsageProvider-reported token usage for an embedding request when available.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
input_tokens |
int | None |
Field(default=None, ge=0) |
total_tokens |
int | None |
Field(default=None, ge=0) |
metadata |
dict[str, Any] |
Field(default_factory=dict) |
validate_token_count (method)
Section titled “validate_token_count (method)”TextEmbeddingUsage.validate_token_count(value: int | None, info) -> int | Nonecopy_metadata (method)
Section titled “copy_metadata (method)”TextEmbeddingUsage.copy_metadata(value: dict[str, Any]) -> dict[str, Any]