Embedding Models Ops
Embedding
Bases: Operation
Extract the embedding vectors from a data model using an EmbeddingModel
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
embedding_model
|
EmbeddingModel
|
The embedding model to use. |
None
|
name
|
str
|
Optional. The name of the operation. |
None
|
description
|
str
|
Optional. Description of the operation. |
None
|
**kwargs
|
keyword warguments
|
Additional keyword arguments send to the embedding model. |
{}
|
Source code in synalinks/src/ops/embedding_models.py
embedding(x, embedding_model=None, name=None, description=None, **kwargs)
async
Extract the embedding vectors from a data model using an EmbeddingModel
.
Embedding consist in converting the given data_model into a vector representation.
This function always output a data model that uses Embeddings
schema.
If the input data model have multiple fields, each one is embedded.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
JsonDataModel | SymbolicDataModel
|
the input data_model |
required |
embedding_model
|
EmbeddingModel
|
The embedding model to use |
None
|
name
|
str
|
Optional. The name of the operation. |
None
|
description
|
str
|
Optional. The description of the operation. |
None
|
**kwargs
|
keyword arguments
|
Additional keywords forwarded to the EmbeddingModel call. |
{}
|
Returns:
Type | Description |
---|---|
JsonDataModel | SymbolicDataModel
|
The resulting data_model |