mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-07 18:35:22 +03:00
#### What I do Adding embedding api for [DashScope](https://help.aliyun.com/product/610100.html), which is the DAMO Academy's multilingual text unified vector model based on the LLM base. It caters to multiple mainstream languages worldwide and offers high-quality vector services, helping developers quickly transform text data into high-quality vector data. Currently supported languages include Chinese, English, Spanish, French, Portuguese, Indonesian, and more. #### Who can review? Models - @hwchase17 - @agola11 --------- Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
1.6 KiB
1.6 KiB
In [ ]:
from langchain.embeddings import DashScopeEmbeddingsIn [ ]:
embeddings = DashScopeEmbeddings(model='text-embedding-v1', dashscope_api_key='your-dashscope-api-key')In [ ]:
text = "This is a test document."In [ ]:
query_result = embeddings.embed_query(text)
print(query_result)In [ ]:
doc_results = embeddings.embed_documents(["foo"])
print(doc_results)