"Beta is the second letter of Greek alphabet",
    ]
)
r2 = deepinfra_emb.embed_query(
    "What is the second letter of Greek alphabet"
)
field embed_instruction: str = 'passage: '#
Instruction used to embed documents.
field model_id: str = 'sentence-transformers/clip-ViT-B-32'#
Embeddings model to use.
field model_kwargs: Optional[dict] = None#
Other model keyword args
field normalize: bool = False#
whether to normalize the computed embeddings
field query_instruction: str = 'query: '#
Instruction used to embed the query.
embed_documents(texts: List[str]) → List[List[float]][source]#
Embed documents using a Deep Infra deployed embedding model.
Parameters
texts – The list of texts to embed.
Returns
List of embeddings, one for each text.
embed_query(text: str) → List[float][source]#
Embed a query using a Deep Infra deployed embedding model.
Parameters
text – The text to embed.
Returns
Embeddings for the text.
class langchain.embeddings.ElasticsearchEmbeddings(client: MlClient, model_id: str, *, input_field: str = 'text_field')[source]#
Wrapper around Elasticsearch embedding models.
This class provides an interface to generate embeddings using a model deployed
in an Elasticsearch cluster. It requires an Elasticsearch connection object
and the model_id of the model deployed in the cluster.
In Elasticsearch you need to have an embedding model loaded and deployed.
- https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-trained-model.html
- https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-deploy-models.html
embed_documents(texts: List[str]) → List[List[float]][source]#
Generate embeddings for a list of documents.
rtdocs_stable/api.python.langchain.com/en/stable/reference/modules/embeddings.html