Package com.tnsai.llm.providers
Class QwenCloudClient
java.lang.Object
com.tnsai.llm.providers.AbstractLLMClient
com.tnsai.llm.providers.AbstractOpenAICompatibleClient
com.tnsai.llm.providers.QwenCloudClient
- All Implemented Interfaces:
com.tnsai.llm.LLMClient
Alibaba Qwen Cloud (DashScope) LLM client.
Alibaba's DashScope is the hosted API for the Qwen family
(Qwen2.5, Qwen3, Qwen-Coder, Qwen-VL). It exposes an
OpenAI-compatible endpoint under the /compatible-mode
path — same chat-completions wire format as GroqClient /
XAIGrokClient / YiClient.
Two regional endpoints:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1— international (default for this client)https://dashscope.aliyuncs.com/compatible-mode/v1— China region; select viaDASHSCOPE_BASE_URLenv or constructorbaseUrlargument
Supported models (at time of writing):
- qwen-max — frontier-tier flagship
- qwen-plus — cost-balanced general-purpose
- qwen-turbo — low-latency small model
- qwen2.5-coder-32b-instruct — coding-specialised
- qwen-vl-max — multimodal (image input)
The catalog evolves quickly; check the live list at help.aliyun.com/zh/model-studio/use-qwen-by-calling-api.
Configuration via environment variables:
DASHSCOPE_API_KEY— Required.DASHSCOPE_BASE_URL— Optional override; defaults to the international endpoint. Set to the China endpoint when routing through mainland-region DashScope.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionQwenCloudClient(String model) QwenCloudClient(String model, float temperature) QwenCloudClient(String model, float temperature, Float topP, Integer maxTokens) QwenCloudClient(String model, float temperature, Integer maxTokens) QwenCloudClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey) QwenCloudClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey) -
Method Summary
Methods inherited from class com.tnsai.llm.providers.AbstractOpenAICompatibleClient
chat, streamChatMethods inherited from class com.tnsai.llm.providers.AbstractLLMClient
getBaseUrl, getCallTimeoutMs, getMaxTokens, getModel, getTemperature, getTopPMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tnsai.llm.LLMClient
chat, chat, chat, chat, chat, getCapabilities, getProviderName, listModels, streamChat, streamChat, streamChatWithHandler, streamChatWithHandler, streamChatWithSpec, streamChatWithSpec
-
Constructor Details
-
QwenCloudClient
-
QwenCloudClient
-
QwenCloudClient
-
QwenCloudClient
-
QwenCloudClient
-
QwenCloudClient
-