Skip to main content
This will help you get started with Qwen chat models. For detailed documentation of all ChatQwen features and configurations head to the API reference.

Overview

Integration details

Model features

Setup

To access Qwen models you’ll need to create an Alibaba Cloud account, get an API key, and install the langchain-qwq integration package.

Credentials

Head to Alibaba’s API Key page to sign up to Alibaba Cloud and generate an API key. Once you’ve done this set the DASHSCOPE_API_KEY environment variable:

Installation

The LangChain Qwen integration lives in the langchain-qwq package:

Instantiation

Now we can instantiate our model object and generate chat completions:

Invocation

Tool calling

ChatQwen supports tool calling API that lets you describe tools and their arguments, and have the model return a JSON object with a tool to invoke and the inputs to that tool.

Use with bind_tools

Vision support

Image

Video


API reference

For detailed documentation of all ChatQwen features and configurations head to the API reference