langchain/docs/modules/models/text_embedding/examples
Jeff Vestal 46e181aa8b
Allow ElasticsearchEmbeddings to create a connection with ES Client object (#5321)
This PR adds a new method `from_es_connection` to the
`ElasticsearchEmbeddings` class allowing users to use Elasticsearch
clusters outside of Elastic Cloud.

Users can create an Elasticsearch Client object and pass that to the new
function.
The returned object is identical to the one returned by calling
`from_credentials`

```
# Create Elasticsearch connection
es_connection = Elasticsearch(
    hosts=['https://es_cluster_url:port'], 
    basic_auth=('user', 'password')
)

# Instantiate ElasticsearchEmbeddings using es_connection
embeddings = ElasticsearchEmbeddings.from_es_connection(
  model_id,
  es_connection,
)
```

I also added examples to the elasticsearch jupyter notebook

Fixes # https://github.com/hwchase17/langchain/issues/5239

---------

Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
2023-05-30 17:26:30 -07:00
..
aleph_alpha.ipynb embedding docs (#2200) 2023-03-30 08:34:14 -07:00
azureopenai.ipynb Fix AzureOpenAI embeddings documentation example. model -> deployment (#4389) 2023-05-17 21:05:53 -07:00
cohere.ipynb
elasticsearch.ipynb Allow ElasticsearchEmbeddings to create a connection with ES Client object (#5321) 2023-05-30 17:26:30 -07:00
fake.ipynb
google_vertex_ai_palm.ipynb Harrison/vertex (#5049) 2023-05-24 15:51:12 -07:00
huggingfacehub.ipynb
instruct_embeddings.ipynb
jina.ipynb
llamacpp.ipynb Fix 'embeddings is not defined' (#2468) 2023-04-06 12:45:45 -07:00
minimax.ipynb Add MiniMax embeddings (#5174) 2023-05-25 06:57:49 -07:00
modelscope_hub.ipynb Harrison/modelscope (#5156) 2023-05-24 08:06:45 -07:00
mosaicml.ipynb Add MosaicML inference endpoints (#4607) 2023-05-23 15:59:08 -07:00
openai.ipynb Added the option of specifying a proxy for the OpenAI API (#5246) 2023-05-25 09:50:25 -07:00
sagemaker-endpoint.ipynb Fix Sagemaker Batch Endpoints (#3249) 2023-04-22 08:49:51 -07:00
self-hosted.ipynb
sentence_transformers.ipynb Sentence Transformers Aliasing (#3541) 2023-04-25 23:29:20 -07:00
tensorflowhub.ipynb