mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
46e181aa8b
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> |
||
---|---|---|
.. | ||
agents | ||
callbacks | ||
chains | ||
indexes | ||
memory | ||
models | ||
prompts | ||
utils/examples | ||
agents.rst | ||
chains.rst | ||
indexes.rst | ||
memory.rst | ||
models.rst | ||
paul_graham_essay.txt | ||
prompts.rst | ||
state_of_the_union.txt |