You’ll need to sign up for an Alibaba API key and set it as an environment variable named ALIBABA_API_KEY.Then, you’ll need to install the @langchain/community package:
import { AlibabaTongyiEmbeddings } from "@langchain/community/embeddings/alibaba_tongyi";const model = new AlibabaTongyiEmbeddings({});const res = await model.embedQuery( "What would be a good company name a company that makes colorful socks?");console.log({ res });