DOCS: doc-string - langchain.vectorstores.dashvector.DashVector (#13502)

- **Description:** There are several mistakes in the sample code in the
doc-string of `DashVector` class, and this pull request aims to correct
them.
The correction code has been tested against latest version (at the time
of creation of this pull request) of: `langchain==0.0.336`
`dashvector==1.0.6` .
- **Issue:** No issue is created for this.
- **Dependencies:** No dependency is required for this change,
<!-- - **Tag maintainer:** for a quicker response, tag the relevant
maintainer (see below), -->
- **Twitter handle:** `zeyanglin`

<!-- Please make sure your PR is passing linting and testing before
submitting. Run `make format`, `make lint` and `make test` to check this
locally.

See contribution guidelines for more information on how to write/run
tests, lint, etc:

https://github.com/langchain-ai/langchain/blob/master/.github/CONTRIBUTING.md

If you're adding a new integration, please include:
1. a test for the integration, preferably unit tests that do not rely on
network access,
2. an example notebook showing its use. It lives in `docs/extras`
directory.

If no one reviews your PR within a few days, please @-mention one of
@baskaryan, @eyurtsev, @hwchase17.
-->
pull/13588/head
Zeyang Lin 10 months ago committed by GitHub
parent 16f7912e1b
commit e53f59f01a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,15 +29,15 @@ class DashVector(VectorStore):
Example:
.. code-block:: python
from langchain.vectorstores import dashvector
from langchain.vectorstores import DashVector
from langchain.embeddings.openai import OpenAIEmbeddings
import dashvector
client = dashvector.Client.init(api_key="***")
client.create("langchain")
client = dashvector.Client(api_key="***")
client.create("langchain", dimension=1024)
collection = client.get("langchain")
embeddings = OpenAIEmbeddings()
vectorstore = Dashvector(collection, embeddings.embed_query, "text")
vectorstore = DashVector(collection, embeddings.embed_query, "text")
"""
def __init__(

Loading…
Cancel
Save