Files
langchain/docs/extras/modules/data_connection/text_embedding/integrations/dashscope.ipynb
T
87e502c6bc Doc refactor (#6300)
Co-authored-by: jacoblee93 <jacoblee93@gmail.com>
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2023-06-16 11:52:56 -07:00

1.6 KiB

DashScope

Let's load the DashScope Embedding class.

In [ ]:
from langchain.embeddings import DashScopeEmbeddings
In [ ]:
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)