class ChatAlibabaTongyiSerializable// Default - uses China region
const qwen = new ChatAlibabaTongyi({
alibabaApiKey: "YOUR-API-KEY",
});
// Specify region explicitly
const qwen = new ChatAlibabaTongyi({
model: "qwen-turbo",
temperature: 1,
region: "singapore", // or "us" or "china"
alibabaApiKey: "YOUR-API-KEY",
});
const messages = [new HumanMessage("Hello")];
await qwen.call(messages);Wrapper around Ali Tongyi large language models that use the Chat endpoint.
To use you should have the ALIBABA_API_KEY
environment variable set.