model_id,
  es_connection,
)
# Create embeddings for multiple documents
documents = [
    'This is an example document.', 
    'Another example document to generate embeddings for.'
]
document_embeddings = embeddings.embed_documents(documents)
# Print document embeddings
for i, embedding in enumerate(document_embeddings):
    print(f"Embedding for document {i+1}: {embedding}")
# Create an embedding for a single query
query = 'This is a single query.'
query_embedding = embeddings.embed_query(query)
# Print query embedding
print(f"Embedding for query: {query_embedding}")
previous
DeepInfra
next
Embaas
 Contents
  
Testing with from_credentials
Testing with Existing Elasticsearch client connection
By Harrison Chase
    
      © Copyright 2023, Harrison Chase.
      
  Last updated on Jun 16, 2023.
rtdocs_stable/api.python.langchain.com/en/stable/modules/models/text_embedding/examples/elasticsearch.html