BaichuanTextEmbeddings()Baichuan Text Embedding models.
Setup:
To use, you should set the environment variable BAICHUAN_API_KEY to
your API key or pass it as a named parameter to the constructor.
.. code-block:: bash
export BAICHUAN_API_KEY="your-api-key"
Instantiate:
.. code-block:: python
from langchain_community.embeddings import BaichuanTextEmbeddings
embeddings = BaichuanTextEmbeddings()
Embed:
.. code-block:: python
vectors = embeddings.embed_documents([text1, text2, ...])
vectors = embeddings.embed_query(text)