Skip to content

Commit a6383fa

Browse files
committed
docs: fix docstrings
1 parent f9d82e1 commit a6383fa

File tree

1 file changed

+23
-34
lines changed

1 file changed

+23
-34
lines changed

libs/elasticsearch/langchain_elasticsearch/_async/vectorstores.py

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -770,24 +770,17 @@ async def afrom_texts(
770770
texts: List of texts to add to the Elasticsearch index.
771771
embedding: Embedding function to use to embed the texts.
772772
metadatas: Optional list of metadatas associated with the texts.
773-
index_name: Name of the Elasticsearch index to create.
774-
es_url: URL of the Elasticsearch instance to connect to.
775-
cloud_id: Cloud ID of the Elasticsearch instance to connect to.
776-
es_user: Username to use when connecting to Elasticsearch.
777-
es_password: Password to use when connecting to Elasticsearch.
778-
es_api_key: API key to use when connecting to Elasticsearch.
779-
client: Optional pre-existing client connection.
780-
Alternatively, provide credentials (es_url, es_cloud_id, etc.).
781-
vector_query_field: Optional. Name of the field to
782-
store the embedding vectors in.
783-
query_field: Optional. Name of the field to store the texts in.
784-
distance_strategy: Optional. Name of the distance
785-
strategy to use. Defaults to "COSINE".
786-
can be one of "COSINE",
787-
"EUCLIDEAN_DISTANCE", "DOT_PRODUCT",
788-
"MAX_INNER_PRODUCT".
789773
bulk_kwargs: Optional. Additional arguments to pass to
790-
Elasticsearch bulk.
774+
Elasticsearch bulk.
775+
client: Optional pre-existing client connection.
776+
777+
Alternatively, provide credentials (`es_url`, `es_cloud_id`, etc.).
778+
**kwargs: Additional keyword arguments passed to the constructor.
779+
780+
See `AsyncElasticsearchStore` for supported options including
781+
`index_name`, `es_url`, `cloud_id`, `es_user`, `es_password`,
782+
`es_api_key`, `vector_query_field`, `query_field`, and
783+
`distance_strategy`.
791784
"""
792785

793786
index_name = kwargs.get("index_name")
@@ -828,24 +821,20 @@ async def afrom_documents(
828821
```
829822
830823
Args:
831-
texts: List of texts to add to the Elasticsearch index.
824+
documents: List of documents to add to the Elasticsearch index.
832825
embedding: Embedding function to use to embed the texts.
833-
Do not provide if using a strategy
834-
that doesn't require inference.
835-
metadatas: Optional list of metadatas associated with the texts.
836-
index_name: Name of the Elasticsearch index to create.
837-
es_url: URL of the Elasticsearch instance to connect to.
838-
cloud_id: Cloud ID of the Elasticsearch instance to connect to.
839-
es_user: Username to use when connecting to Elasticsearch.
840-
es_password: Password to use when connecting to Elasticsearch.
841-
es_api_key: API key to use when connecting to Elasticsearch.
842-
client: Optional pre-existing client connection.
843-
Alternatively, provide credentials (es_url, es_cloud_id, etc.).
844-
vector_query_field: Optional. Name of the field
845-
to store the embedding vectors in.
846-
query_field: Optional. Name of the field to store the texts in.
826+
Do not provide if using a strategy
827+
that doesn't require inference.
847828
bulk_kwargs: Optional. Additional arguments to pass to
848-
Elasticsearch bulk.
829+
Elasticsearch bulk.
830+
client: Optional pre-existing client connection.
831+
832+
Alternatively, provide credentials (`es_url`, `es_cloud_id`, etc.).
833+
**kwargs: Additional keyword arguments passed to the constructor.
834+
835+
See `AsyncElasticsearchStore` for supported options including
836+
`index_name`, `es_url`, `cloud_id`, `es_user`, `es_password`,
837+
`es_api_key`, `vector_query_field`, and `query_field`.
849838
"""
850839

851840
index_name = kwargs.get("index_name")
@@ -936,6 +925,6 @@ def BM25RetrievalStrategy(
936925
k1: Optional. This corresponds to the BM25 parameter, k1. Default is None,
937926
which uses the default setting of Elasticsearch.
938927
b: Optional. This corresponds to the BM25 parameter, b. Default is None,
939-
which uses the default setting of Elasticsearch.
928+
which uses the default setting of Elasticsearch.
940929
"""
941930
return BM25RetrievalStrategy(k1=k1, b=b)

0 commit comments

Comments
 (0)