視覚的推論モデルは、まず思考プロセスを出力してから回答を提供します。これにより、数学の問題を解く、チャートデータを分析する、複雑な動画を理解するなど、複雑な視覚分析タスクに適しています。
ショーケース
上記のコンポーネントはデモ用であり、実際のリクエストは送信されません。
利用可能状況
サポートリージョン
サポートモデル
グローバル
グローバルデプロイメントモードでは、エンドポイントとデータストレージは米国 (バージニア) リージョンに配置され、モデル推論の計算リソースは世界中で動的にスケジューリングされます。
ハイブリッド思考モデル: qwen3-vl-plus、qwen3-vl-plus-2025-09-23、qwen3-vl-flash、qwen3-vl-flash-2025-10-15
思考専用モデル: qwen3-vl-235b-a22b-thinking、qwen3-vl-32b-thinking、qwen3-vl-30b-a3b-thinking、qwen3-vl-8b-thinking
国際
国際デプロイメントモードでは、エンドポイントとデータストレージはシンガポールリージョンに配置され、モデル推論の計算リソースは中国本土を除き、グローバルに動的にスケジューリングされます。
Qwen3-VL
ハイブリッド思考モデル: qwen3-vl-plus、qwen3-vl-plus-2025-12-19、qwen3-vl-plus-2025-09-23、qwen3-vl-flash、qwen3-vl-flash-2025-10-15
思考専用モデル: qwen3-vl-235b-a22b-thinking、qwen3-vl-32b-thinking、qwen3-vl-30b-a3b-thinking、qwen3-vl-8b-thinking
QVQ
思考専用モデル: qvq-max シリーズ、qvq-plus シリーズ
米国
米国デプロイメントモードでは、エンドポイントとデータストレージは米国 (バージニア) リージョンに配置され、モデル推論の計算リソースは米国内に限定されます。
ハイブリッド思考モデル: qwen3-vl-flash-us、qwen3-vl-flash-2025-10-15-us
中国本土
中国本土の デプロイメントモードでは、エンドポイントとデータストレージは北京リージョンに配置され、モデル推論の計算リソースは中国本土に限定されます。
Qwen3-VL
ハイブリッド思考モデル: qwen3-vl-plus、qwen3-vl-plus-2025-12-19、qwen3-vl-plus-2025-09-23、qwen3-vl-flash、qwen3-vl-flash-2025-10-15
思考専用モデル: qwen3-vl-235b-a22b-thinking、qwen3-vl-32b-thinking、qwen3-vl-30b-a3b-thinking、qwen3-vl-8b-thinking
QVQ
思考専用モデル: qvq-max シリーズ、qvq-plus シリーズ
利用ガイド
思考プロセス:Model Studio は、ハイブリッド思考と思考専用の 2 種類の視覚的推論モデルを提供します。
ハイブリッド思考モデル:
enable_thinkingパラメーターを使用して、思考の動作を制御できます。trueに設定すると、思考が有効になります。モデルはまず思考プロセスを出力し、次に最終的な応答を出力します。falseに設定すると、思考が無効になります。モデルは直接応答を生成します。
思考専用モデル: これらのモデルは、応答を提供する前に常に思考プロセスを生成し、この動作を無効にすることはできません。
出力方法: 視覚的推論モデルには詳細な思考プロセスが含まれるため、長い応答によるタイムアウトを防ぐためにストリーミング出力を使用することを推奨します。
Qwen3-VL シリーズは、ストリーミングと非ストリーミングの両方のメソッドをサポートしています。
QVQ シリーズは、ストリーミング出力のみをサポートしています。
システムプロンプトの推奨事項:
単一ターンまたは単純な会話の場合: 最良の推論結果を得るために、
System Messageを設定しないでください。モデルのロール設定や出力フォーマット要件などの命令は、User Messageを通じて渡します。エージェントの構築やツール呼び出しの実装などの複雑なアプリケーションの場合:
System Messageを使用して、モデルのロール、機能、および動作のフレームワークを定義し、その安定性と信頼性を確保します。
はじめに
前提条件
API キーを作成し、API キーを環境変数としてエクスポート済みであること。
SDK を使用してモデルを呼び出す場合は、最新バージョンの SDK をインストールします。DashScope Python SDK はバージョン 1.24.6 以降、DashScope Java SDK はバージョン 2.21.10 以降である必要があります。
次の例では、qvq-max モデルを呼び出して、画像から数学の問題を解く方法を示します。これらの例では、ストリーミング出力を使用して、思考プロセスと最終的な応答を別々に出力します。
OpenAI 互換
Python
from openai import OpenAI
import os
# OpenAI クライアントを初期化します
client = OpenAI(
# API キーはリージョンによって異なります。取得するには、https://bailian.console.alibabacloud.com/?tab=model#/api-key をご参照ください
# 環境変数を設定していない場合は、次の行を Model Studio の API キーに置き換えてください: api_key="sk-xxx"
api_key = os.getenv("DASHSCOPE_API_KEY"),
# 以下はシンガポールリージョンのベース URL です。北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/compatible-mode/v1 に置き換えてください
base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
)
reasoning_content = "" # 完全な思考プロセスを定義します
answer_content = "" # 完全な応答を定義します
is_answering = False # 思考プロセスが終了し、応答が開始されたかどうかを確認します
# チャット補完リクエストを作成します
completion = client.chat.completions.create(
model="qvq-max", # この例では qvq-max を使用します。必要に応じて、他のモデル名に置き換えることができます。
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
},
},
{"type": "text", "text": "この問題の解き方を教えてください。"},
],
},
],
stream=True,
# 次のコメントを解除すると、最後のチャンクでトークン使用量が返されます
# stream_options={
# "include_usage": True
# }
)
print("\n" + "=" * 20 + "思考プロセス" + "=" * 20 + "\n")
for chunk in completion:
# chunk.choices が空の場合、使用量を出力します
if not chunk.choices:
print("\n使用量:")
print(chunk.usage)
else:
delta = chunk.choices[0].delta
# 思考プロセスを出力します
if hasattr(delta, 'reasoning_content') and delta.reasoning_content != None:
print(delta.reasoning_content, end='', flush=True)
reasoning_content += delta.reasoning_content
else:
# 応答を開始します
if delta.content != "" and is_answering is False:
print("\n" + "=" * 20 + "完全な応答" + "=" * 20 + "\n")
is_answering = True
# 応答プロセスを出力します
print(delta.content, end='', flush=True)
answer_content += delta.content
# print("=" * 20 + "完全な思考プロセス" + "=" * 20 + "\n")
# print(reasoning_content)
# print("=" * 20 + "完全な応答" + "=" * 20 + "\n")
# print(answer_content)Node.js
import OpenAI from "openai";
import process from 'process';
// OpenAI クライアントを初期化します
const openai = new OpenAI({
apiKey: process.env.DASHSCOPE_API_KEY, // 環境変数から読み取ります。API キーはリージョンによって異なります。取得するには、https://bailian.console.alibabacloud.com/?tab=model#/api-key をご参照ください
// 以下はシンガポールリージョンのベース URL です。北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/compatible-mode/v1 に置き換えてください
baseURL: 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1'
});
let reasoningContent = '';
let answerContent = '';
let isAnswering = false;
let messages = [
{
role: "user",
content: [
{ type: "image_url", image_url: { "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg" } },
{ type: "text", text: "この問題を解いてください" },
]
}]
async function main() {
try {
const stream = await openai.chat.completions.create({
model: 'qvq-max',
messages: messages,
stream: true
});
console.log('\n' + '='.repeat(20) + '思考プロセス' + '='.repeat(20) + '\n');
for await (const chunk of stream) {
if (!chunk.choices?.length) {
console.log('\n使用量:');
console.log(chunk.usage);
continue;
}
const delta = chunk.choices[0].delta;
// 思考プロセスを処理します
if (delta.reasoning_content) {
process.stdout.write(delta.reasoning_content);
reasoningContent += delta.reasoning_content;
}
// 正式な応答を処理します
else if (delta.content) {
if (!isAnswering) {
console.log('\n' + '='.repeat(20) + '完全な応答' + '='.repeat(20) + '\n');
isAnswering = true;
}
process.stdout.write(delta.content);
answerContent += delta.content;
}
}
} catch (error) {
console.error('エラー:', error);
}
}
main();HTTP
# ======= 重要 =======
# 以下はシンガポールリージョンのベース URL です。北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions に置き換えてください
# API キーはリージョンによって異なります。取得するには、https://bailian.console.alibabacloud.com/?tab=model#/api-key をご参照ください
# === 実行前にこのコメントを削除してください ===
curl --location 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "qvq-max",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
}
},
{
"type": "text",
"text": "この問題を解いてください"
}
]
}
],
"stream":true,
"stream_options":{"include_usage":true}
}'DashScope
DashScope を使用して QVQ モデルを呼び出す場合:
incremental_outputパラメーターはデフォルトでtrueであり、falseに設定することはできません。増分ストリーミング出力のみがサポートされています。result_formatパラメーターはデフォルトで"message"であり、"text"に設定することはできません。
Python
import os
import dashscope
from dashscope import MultiModalConversation
# 以下はシンガポールリージョンのベース URL です。北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/api/v1 に置き換えてください
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
messages = [
{
"role": "user",
"content": [
{"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
{"text": "この問題の解き方を教えてください。"}
]
}
]
response = MultiModalConversation.call(
# API キーはリージョンによって異なります。取得するには、https://bailian.console.alibabacloud.com/?tab=model#/api-key をご参照ください
# 環境変数が設定されていない場合は、次の行を Model Studio の API キーに置き換えてください: api_key="sk-xxx",
api_key=os.getenv('DASHSCOPE_API_KEY'),
model="qvq-max", # この例では qvq-max を使用します。必要に応じて、他のモデル名に置き換えることができます。
messages=messages,
stream=True,
)
# 完全な思考プロセスを定義します
reasoning_content = ""
# 完全な応答を定義します
answer_content = ""
# 思考プロセスが終了し、応答が開始されたかどうかを確認します
is_answering = False
print("=" * 20 + "思考プロセス" + "=" * 20)
for chunk in response:
# 思考プロセスと応答の両方が空の場合は無視します
message = chunk.output.choices[0].message
reasoning_content_chunk = message.get("reasoning_content", None)
if (chunk.output.choices[0].message.content == [] and
reasoning_content_chunk == ""):
pass
else:
# 現在が思考プロセスの場合
if reasoning_content_chunk != None and chunk.output.choices[0].message.content == []:
print(chunk.output.choices[0].message.reasoning_content, end="")
reasoning_content += chunk.output.choices[0].message.reasoning_content
# 現在が応答の場合
elif chunk.output.choices[0].message.content != []:
if not is_answering:
print("\n" + "=" * 20 + "完全な応答" + "=" * 20)
is_answering = True
print(chunk.output.choices[0].message.content[0]["text"], end="")
answer_content += chunk.output.choices[0].message.content[0]["text"]
# 完全な思考プロセスと応答を出力するには、次のコードのコメントを解除して実行してください
# print("=" * 20 + "完全な思考プロセス" + "=" * 20 + "\n")
# print(f"{reasoning_content}")
# print("=" * 20 + "完全な応答" + "=" * 20 + "\n")
# print(f"{answer_content}")Java
// DashScope SDK バージョン >= 2.19.0
import java.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dashscope.common.Role;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import io.reactivex.Flowable;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversation;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationParam;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationResult;
import com.alibaba.dashscope.common.MultiModalMessage;
import com.alibaba.dashscope.exception.UploadFileException;
import com.alibaba.dashscope.exception.InputRequiredException;
import java.lang.System;
import com.alibaba.dashscope.utils.Constants;
public class Main {
static {
// 以下はシンガポールリージョンのベース URL です。北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/api/v1 に置き換えてください
Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
}
private static final Logger logger = LoggerFactory.getLogger(Main.class);
private static StringBuilder reasoningContent = new StringBuilder();
private static StringBuilder finalContent = new StringBuilder();
private static boolean isFirstPrint = true;
private static void handleGenerationResult(MultiModalConversationResult message) {
String re = message.getOutput().getChoices().get(0).getMessage().getReasoningContent();
String reasoning = Objects.isNull(re)?"":re; // デフォルト値
List<Map<String, Object>> content = message.getOutput().getChoices().get(0).getMessage().getContent();
if (!reasoning.isEmpty()) {
reasoningContent.append(reasoning);
if (isFirstPrint) {
System.out.println("====================思考プロセス====================");
isFirstPrint = false;
}
System.out.print(reasoning);
}
if (Objects.nonNull(content) && !content.isEmpty()) {
Object text = content.get(0).get("text");
finalContent.append(content.get(0).get("text"));
if (!isFirstPrint) {
System.out.println("\n====================完全な応答====================");
isFirstPrint = true;
}
System.out.print(text);
}
}
public static MultiModalConversationParam buildMultiModalConversationParam(MultiModalMessage Msg) {
return MultiModalConversationParam.builder()
// API キーはリージョンによって異なります。取得するには、https://bailian.console.alibabacloud.com/?tab=model#/api-key をご参照ください
// 環境変数を設定していない場合は、次の行を Model Studio の API キーに置き換えてください: .apiKey("sk-xxx")
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
// この例では qvq-max を使用します。必要に応じて、他のモデル名に置き換えることができます。
.model("qvq-max")
.messages(Arrays.asList(Msg))
.incrementalOutput(true)
.build();
}
public static void streamCallWithMessage(MultiModalConversation conv, MultiModalMessage Msg)
throws NoApiKeyException, ApiException, InputRequiredException, UploadFileException {
MultiModalConversationParam param = buildMultiModalConversationParam(Msg);
Flowable<MultiModalConversationResult> result = conv.streamCall(param);
result.blockingForEach(message -> {
handleGenerationResult(message);
});
}
public static void main(String[] args) {
try {
MultiModalConversation conv = new MultiModalConversation();
MultiModalMessage userMsg = MultiModalMessage.builder()
.role(Role.USER.getValue())
.content(Arrays.asList(Collections.singletonMap("image", "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"),
Collections.singletonMap("text", "この問題を解いてください")))
.build();
streamCallWithMessage(conv, userMsg);
// 最終結果を出力します
// if (reasoningContent.length() > 0) {
// System.out.println("\n====================完全な応答====================");
// System.out.println(finalContent.toString());
// }
} catch (ApiException | NoApiKeyException | UploadFileException | InputRequiredException e) {
logger.error("An exception occurred: {}", e.getMessage());
}
System.exit(0);
}
}HTTP
curl
# ======= 重要 =======
# 以下はシンガポールリージョンのベース URL です。北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation に置き換えてください
# API キーはリージョンによって異なります。取得するには、https://bailian.console.alibabacloud.com/?tab=model#/api-key をご参照ください
# === 実行前にこのコメントを削除してください ===
curl -X POST https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-H 'X-DashScope-SSE: enable' \
-d '{
"model": "qvq-max",
"input":{
"messages":[
{
"role": "user",
"content": [
{"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
{"text": "この問題を解いてください"}
]
}
]
}
}'コア機能
思考プロセスの有効化/無効化
問題解決やレポート分析など、詳細な思考プロセスが必要なシナリオでは、enable_thinking パラメーターを使用して思考モードを有効にできます。次の例では、その方法を示します。
enable_thinking パラメーターは、qwen3-vl-plus および qwen3-vl-flash シリーズのモデルでのみサポートされています。
OpenAI 互換
enable_thinking および thinking_budget パラメーターは、標準の OpenAI パラメーターではありません。これらのパラメーターを渡す方法は、プログラミング言語によって異なります。
Python SDK:
extra_bodyディクショナリを介して渡す必要があります。Node.js SDK:トップレベルのパラメーターとして直接渡すことができます。
import os
from openai import OpenAI
client = OpenAI(
# API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
api_key=os.getenv("DASHSCOPE_API_KEY"),
# 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/compatible-mode/v1 に置き換えてください
# 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/compatible-mode/v1 に置き換えてください
base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
)
reasoning_content = "" # 完全な思考プロセスを定義します
answer_content = "" # 完全な応答を定義します
is_answering = False # 思考プロセスが終了し、応答が開始されたかどうかを確認します
enable_thinking = True
# チャット補完リクエストを作成します
completion = client.chat.completions.create(
model="qwen3-vl-plus",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
},
},
{"type": "text", "text": "この問題の解き方を教えてください。"},
],
},
],
stream=True,
# enable_thinking パラメーターは思考プロセスを有効にします。thinking_budget パラメーターは、推論プロセスの最大トークン数を設定します。
# qwen3-vl-plus および qwen3-vl-flash の場合、enable_thinking を使用して思考を有効または無効にできます。「thinking」サフィックスを持つモデル (qwen3-vl-235b-a22b-thinking など) の場合、enable_thinking は true にしか設定できません。このパラメーターは他の Qwen-VL モデルには適用されません。
extra_body={
'enable_thinking': enable_thinking
},
# 次のコメントを解除すると、最後のチャンクでトークン使用量が返されます
# stream_options={
# "include_usage": True
# }
)
if enable_thinking:
print("\n" + "=" * 20 + "思考プロセス" + "=" * 20 + "\n")
for chunk in completion:
# chunk.choices が空の場合、使用量を出力します
if not chunk.choices:
print("\n使用量:")
print(chunk.usage)
else:
delta = chunk.choices[0].delta
# 思考プロセスを出力します
if hasattr(delta, 'reasoning_content') and delta.reasoning_content != None:
print(delta.reasoning_content, end='', flush=True)
reasoning_content += delta.reasoning_content
else:
# 応答を開始します
if delta.content != "" and is_answering is False:
print("\n" + "=" * 20 + "完全な応答" + "=" * 20 + "\n")
is_answering = True
# 応答プロセスを出力します
print(delta.content, end='', flush=True)
answer_content += delta.content
# print("=" * 20 + "完全な思考プロセス" + "=" * 20 + "\n")
# print(reasoning_content)
# print("=" * 20 + "完全な応答" + "=" * 20 + "\n")
# print(answer_content)import OpenAI from "openai";
// OpenAI クライアントを初期化します
const openai = new OpenAI({
// API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
// 環境変数を設定していない場合は、次の行を Model Studio の API キーに置き換えてください: apiKey: "sk-xxx"
apiKey: process.env.DASHSCOPE_API_KEY,
// 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/compatible-mode/v1 に置き換えてください
// 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/compatible-mode/v1 に置き換えてください
baseURL: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
});
let reasoningContent = '';
let answerContent = '';
let isAnswering = false;
let enableThinking = true;
let messages = [
{
role: "user",
content: [
{ type: "image_url", image_url: { "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg" } },
{ type: "text", text: "この問題を解いてください" },
]
}]
async function main() {
try {
const stream = await openai.chat.completions.create({
model: 'qwen3-vl-plus',
messages: messages,
stream: true,
// 注:Node.js SDK では、enableThinking のような非標準パラメーターはトップレベルのプロパティとして渡され、extra_body に含める必要はありません。
enable_thinking: enableThinking
});
if (enableThinking){console.log('\n' + '='.repeat(20) + '思考プロセス' + '='.repeat(20) + '\n');}
for await (const chunk of stream) {
if (!chunk.choices?.length) {
console.log('\n使用量:');
console.log(chunk.usage);
continue;
}
const delta = chunk.choices[0].delta;
// 思考プロセスを処理します
if (delta.reasoning_content) {
process.stdout.write(delta.reasoning_content);
reasoningContent += delta.reasoning_content;
}
// 正式な応答を処理します
else if (delta.content) {
if (!isAnswering) {
console.log('\n' + '='.repeat(20) + '完全な応答' + '='.repeat(20) + '\n');
isAnswering = true;
}
process.stdout.write(delta.content);
answerContent += delta.content;
}
}
} catch (error) {
console.error('エラー:', error);
}
}
main();# ======= 重要 =======
# 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/compatible-mode/v1/chat/completions に置き換えてください
# 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions に置き換えてください
# API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
# === 実行前にこのコメントを削除してください ===
curl --location 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen3-vl-plus",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
}
},
{
"type": "text",
"text": "この問題を解いてください"
}
]
}
],
"stream":true,
"stream_options":{"include_usage":true},
"enable_thinking": true
}'DashScope
import os
import dashscope
from dashscope import MultiModalConversation
# 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/api/v1 に置き換えてください
# 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/api/v1 に置き換えてください
dashscope.base_http_api_url = "https://dashscope-intl.aliyuncs.com/api/v1"
enable_thinking = True
messages = [
{
"role": "user",
"content": [
{"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
{"text": "この問題の解き方を教えてください。"}
]
}
]
response = MultiModalConversation.call(
# 環境変数を設定していない場合は、次の行を Model Studio の API キーに置き換えてください: api_key="sk-xxx",
# API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
api_key=os.getenv('DASHSCOPE_API_KEY'),
model="qwen3-vl-plus",
messages=messages,
stream=True,
# enable_thinking パラメーターは思考プロセスを有効にします。
# qwen3-vl-plus および qwen3-vl-flash の場合、enable_thinking を使用して思考を有効または無効にできます。「thinking」サフィックスを持つモデル (qwen3-vl-235b-a22b-thinking など) の場合、enable_thinking は true にしか設定できません。このパラメーターは他の Qwen-VL モデルには適用されません。
enable_thinking=enable_thinking
)
# 完全な思考プロセスを定義します
reasoning_content = ""
# 完全な応答を定義します
answer_content = ""
# 思考プロセスが終了し、応答が開始されたかどうかを確認します
is_answering = False
if enable_thinking:
print("=" * 20 + "思考プロセス" + "=" * 20)
for chunk in response:
# 思考プロセスと応答の両方が空の場合は無視します
message = chunk.output.choices[0].message
reasoning_content_chunk = message.get("reasoning_content", None)
if (chunk.output.choices[0].message.content == [] and
reasoning_content_chunk == ""):
pass
else:
# 現在が思考プロセスの場合
if reasoning_content_chunk != None and chunk.output.choices[0].message.content == []:
print(chunk.output.choices[0].message.reasoning_content, end="")
reasoning_content += chunk.output.choices[0].message.reasoning_content
# 現在が応答の場合
elif chunk.output.choices[0].message.content != []:
if not is_answering:
print("\n" + "=" * 20 + "完全な応答" + "=" * 20)
is_answering = True
print(chunk.output.choices[0].message.content[0]["text"], end="")
answer_content += chunk.output.choices[0].message.content[0]["text"]
# 完全な思考プロセスと応答を出力するには、次のコードのコメントを解除して実行してください
# print("=" * 20 + "完全な思考プロセス" + "=" * 20 + "\n")
# print(f"{reasoning_content}")
# print("=" * 20 + "完全な応答" + "=" * 20 + "\n")
# print(f"{answer_content}")// DashScope SDK バージョン >= 2.21.10
import java.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dashscope.common.Role;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import io.reactivex.Flowable;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversation;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationParam;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationResult;
import com.alibaba.dashscope.common.MultiModalMessage;
import com.alibaba.dashscope.exception.UploadFileException;
import com.alibaba.dashscope.exception.InputRequiredException;
import java.lang.System;
import com.alibaba.dashscope.utils.Constants;
public class Main {
// 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/api/v1 に置き換えてください
// 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/api/v1 に置き換えてください
static {Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";}
private static final Logger logger = LoggerFactory.getLogger(Main.class);
private static StringBuilder reasoningContent = new StringBuilder();
private static StringBuilder finalContent = new StringBuilder();
private static boolean isFirstPrint = true;
private static void handleGenerationResult(MultiModalConversationResult message) {
String re = message.getOutput().getChoices().get(0).getMessage().getReasoningContent();
String reasoning = Objects.isNull(re)?"":re; // デフォルト値
List<Map<String, Object>> content = message.getOutput().getChoices().get(0).getMessage().getContent();
if (!reasoning.isEmpty()) {
reasoningContent.append(reasoning);
if (isFirstPrint) {
System.out.println("====================思考プロセス====================");
isFirstPrint = false;
}
System.out.print(reasoning);
}
if (Objects.nonNull(content) && !content.isEmpty()) {
Object text = content.get(0).get("text");
finalContent.append(content.get(0).get("text"));
if (!isFirstPrint) {
System.out.println("\n====================完全な応答====================");
isFirstPrint = true;
}
System.out.print(text);
}
}
public static MultiModalConversationParam buildMultiModalConversationParam(MultiModalMessage Msg) {
return MultiModalConversationParam.builder()
// 環境変数を設定していない場合は、次の行を Model Studio の API キーに置き換えてください: .apiKey("sk-xxx")
// API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
.model("qwen3-vl-plus")
.messages(Arrays.asList(Msg))
.enableThinking(true)
.incrementalOutput(true)
.build();
}
public static void streamCallWithMessage(MultiModalConversation conv, MultiModalMessage Msg)
throws NoApiKeyException, ApiException, InputRequiredException, UploadFileException {
MultiModalConversationParam param = buildMultiModalConversationParam(Msg);
Flowable<MultiModalConversationResult> result = conv.streamCall(param);
result.blockingForEach(message -> {
handleGenerationResult(message);
});
}
public static void main(String[] args) {
try {
MultiModalConversation conv = new MultiModalConversation();
MultiModalMessage userMsg = MultiModalMessage.builder()
.role(Role.USER.getValue())
.content(Arrays.asList(Collections.singletonMap("image", "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"),
Collections.singletonMap("text", "この問題を解いてください")))
.build();
streamCallWithMessage(conv, userMsg);
// 最終結果を出力します
// if (reasoningContent.length() > 0) {
// System.out.println("\n====================完全な応答====================");
// System.out.println(finalContent.toString());
// }
} catch (ApiException | NoApiKeyException | UploadFileException | InputRequiredException e) {
logger.error("An exception occurred: {}", e.getMessage());
}
System.exit(0);
}
}# ======= 重要 =======
# API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
# 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation に置き換えてください
# 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation に置き換えてください
# === 実行前にこのコメントを削除してください ===
curl -X POST https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-H 'X-DashScope-SSE: enable' \
-d '{
"model": "qwen3-vl-plus",
"input":{
"messages":[
{
"role": "user",
"content": [
{"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
{"text": "この問題を解いてください"}
]
}
]
},
"parameters":{
"enable_thinking": true,
"incremental_output": true
}
}'思考の長さの制限
モデルが長すぎる思考プロセスを生成するのを防ぐには、thinking_budget パラメーターを使用して、思考プロセス用に生成される最大トークン数を制限します。思考プロセスがこの制限を超えると、コンテンツは切り捨てられ、モデルはすぐに最終的な回答の生成を開始します。thinking_budget のデフォルト値は、モデルの最大連鎖的思考長です。詳細については、「モデルリスト」をご参照ください。
thinking_budget パラメーターは、Qwen3-VL (思考モード) でのみサポートされています。
OpenAI 互換
thinking_budget パラメーターは、標準の OpenAI パラメーターではありません。OpenAI Python SDK を使用する場合、extra_body を介して渡す必要があります。
import os
from openai import OpenAI
client = OpenAI(
# API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
api_key=os.getenv("DASHSCOPE_API_KEY"),
# 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/compatible-mode/v1 に置き換えてください
# 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/compatible-mode/v1 に置き換えてください
base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
)
reasoning_content = "" # 完全な思考プロセスを定義します
answer_content = "" # 完全な応答を定義します
is_answering = False # 思考プロセスが終了し、応答が開始されたかどうかを確認します
enable_thinking = True
# チャット補完リクエストを作成します
completion = client.chat.completions.create(
model="qwen3-vl-plus",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
},
},
{"type": "text", "text": "この問題の解き方を教えてください。"},
],
},
],
stream=True,
# enable_thinking パラメーターは思考プロセスを有効にします。thinking_budget パラメーターは、推論プロセスの最大トークン数を設定します。
# qwen3-vl-plus および qwen3-vl-flash の場合、enable_thinking を使用して思考を有効または無効にできます。「thinking」サフィックスを持つモデル (qwen3-vl-235b-a22b-thinking など) の場合、enable_thinking は true にしか設定できません。このパラメーターは他の Qwen-VL モデルには適用されません。
extra_body={
'enable_thinking': enable_thinking,
"thinking_budget": 81920},
# 次のコメントを解除すると、最後のチャンクでトークン使用量が返されます
# stream_options={
# "include_usage": True
# }
)
if enable_thinking:
print("\n" + "=" * 20 + "思考プロセス" + "=" * 20 + "\n")
for chunk in completion:
# chunk.choices が空の場合、使用量を出力します
if not chunk.choices:
print("\n使用量:")
print(chunk.usage)
else:
delta = chunk.choices[0].delta
# 思考プロセスを出力します
if hasattr(delta, 'reasoning_content') and delta.reasoning_content != None:
print(delta.reasoning_content, end='', flush=True)
reasoning_content += delta.reasoning_content
else:
# 応答を開始します
if delta.content != "" and is_answering is False:
print("\n" + "=" * 20 + "完全な応答" + "=" * 20 + "\n")
is_answering = True
# 応答プロセスを出力します
print(delta.content, end='', flush=True)
answer_content += delta.content
# print("=" * 20 + "完全な思考プロセス" + "=" * 20 + "\n")
# print(reasoning_content)
# print("=" * 20 + "完全な応答" + "=" * 20 + "\n")
# print(answer_content)import OpenAI from "openai";
// OpenAI クライアントを初期化します
const openai = new OpenAI({
// API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
// 環境変数を設定していない場合は、次の行を Model Studio の API キーに置き換えてください: apiKey: "sk-xxx"
apiKey: process.env.DASHSCOPE_API_KEY,
// 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/compatible-mode/v1 に置き換えてください
// 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/compatible-mode/v1 に置き換えてください
baseURL: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
});
let reasoningContent = '';
let answerContent = '';
let isAnswering = false;
let enableThinking = true;
let messages = [
{
role: "user",
content: [
{ type: "image_url", image_url: { "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg" } },
{ type: "text", text: "この問題を解いてください" },
]
}]
async function main() {
try {
const stream = await openai.chat.completions.create({
model: 'qwen3-vl-plus',
messages: messages,
stream: true,
// 注:Node.js SDK では、enableThinking のような非標準パラメーターはトップレベルのプロパティとして渡され、extra_body に含める必要はありません。
enable_thinking: enableThinking,
thinking_budget: 81920
});
if (enableThinking){console.log('\n' + '='.repeat(20) + '思考プロセス' + '='.repeat(20) + '\n');}
for await (const chunk of stream) {
if (!chunk.choices?.length) {
console.log('\n使用量:');
console.log(chunk.usage);
continue;
}
const delta = chunk.choices[0].delta;
// 思考プロセスを処理します
if (delta.reasoning_content) {
process.stdout.write(delta.reasoning_content);
reasoningContent += delta.reasoning_content;
}
// 正式な応答を処理します
else if (delta.content) {
if (!isAnswering) {
console.log('\n' + '='.repeat(20) + '完全な応答' + '='.repeat(20) + '\n');
isAnswering = true;
}
process.stdout.write(delta.content);
answerContent += delta.content;
}
}
} catch (error) {
console.error('エラー:', error);
}
}
main();# ======= 重要 =======
# 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/compatible-mode/v1/chat/completions に置き換えてください
# 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions に置き換えてください
# API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
# === 実行前にこのコメントを削除してください ===
curl --location 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen3-vl-plus",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
}
},
{
"type": "text",
"text": "この問題を解いてください"
}
]
}
],
"stream":true,
"stream_options":{"include_usage":true},
"enable_thinking": true,
"thinking_budget": 81920
}'DashScope
import os
import dashscope
from dashscope import MultiModalConversation
# 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/api/v1 に置き換えてください
# 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/api/v1 に置き換えてください
dashscope.base_http_api_url = "https://dashscope-intl.aliyuncs.com/api/v1"
enable_thinking = True
messages = [
{
"role": "user",
"content": [
{"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
{"text": "この問題の解き方を教えてください。"}
]
}
]
response = MultiModalConversation.call(
# 環境変数を設定していない場合は、次の行を Model Studio の API キーに置き換えてください: api_key="sk-xxx",
# API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
api_key=os.getenv('DASHSCOPE_API_KEY'),
model="qwen3-vl-plus",
messages=messages,
stream=True,
# enable_thinking パラメーターは思考プロセスを有効にします。
# qwen3-vl-plus および qwen3-vl-flash の場合、enable_thinking を使用して思考を有効または無効にできます。「thinking」サフィックスを持つモデル (qwen3-vl-235b-a22b-thinking など) の場合、enable_thinking は true にしか設定できません。このパラメーターは他の Qwen-VL モデルには適用されません。
enable_thinking=enable_thinking,
# thinking_budget パラメーターは、推論プロセスの最大トークン数を設定します。
thinking_budget=81920,
)
# 完全な思考プロセスを定義します
reasoning_content = ""
# 完全な応答を定義します
answer_content = ""
# 思考プロセスが終了し、応答が開始されたかどうかを確認します
is_answering = False
if enable_thinking:
print("=" * 20 + "思考プロセス" + "=" * 20)
for chunk in response:
# 思考プロセスと応答の両方が空の場合は無視します
message = chunk.output.choices[0].message
reasoning_content_chunk = message.get("reasoning_content", None)
if (chunk.output.choices[0].message.content == [] and
reasoning_content_chunk == ""):
pass
else:
# 現在が思考プロセスの場合
if reasoning_content_chunk != None and chunk.output.choices[0].message.content == []:
print(chunk.output.choices[0].message.reasoning_content, end="")
reasoning_content += chunk.output.choices[0].message.reasoning_content
# 現在が応答の場合
elif chunk.output.choices[0].message.content != []:
if not is_answering:
print("\n" + "=" * 20 + "完全な応答" + "=" * 20)
is_answering = True
print(chunk.output.choices[0].message.content[0]["text"], end="")
answer_content += chunk.output.choices[0].message.content[0]["text"]
# 完全な思考プロセスと応答を出力するには、次のコードのコメントを解除して実行してください
# print("=" * 20 + "完全な思考プロセス" + "=" * 20 + "\n")
# print(f"{reasoning_content}")
# print("=" * 20 + "完全な応答" + "=" * 20 + "\n")
# print(f"{answer_content}")// DashScope SDK バージョン >= 2.21.10
import java.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dashscope.common.Role;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import io.reactivex.Flowable;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversation;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationParam;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationResult;
import com.alibaba.dashscope.common.MultiModalMessage;
import com.alibaba.dashscope.exception.UploadFileException;
import com.alibaba.dashscope.exception.InputRequiredException;
import java.lang.System;
import com.alibaba.dashscope.utils.Constants;
public class Main {
// 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/api/v1 に置き換えてください
// 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/api/v1 に置き換えてください
static {Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";}
private static final Logger logger = LoggerFactory.getLogger(Main.class);
private static StringBuilder reasoningContent = new StringBuilder();
private static StringBuilder finalContent = new StringBuilder();
private static boolean isFirstPrint = true;
private static void handleGenerationResult(MultiModalConversationResult message) {
String re = message.getOutput().getChoices().get(0).getMessage().getReasoningContent();
String reasoning = Objects.isNull(re)?"":re; // デフォルト値
List<Map<String, Object>> content = message.getOutput().getChoices().get(0).getMessage().getContent();
if (!reasoning.isEmpty()) {
reasoningContent.append(reasoning);
if (isFirstPrint) {
System.out.println("====================思考プロセス====================");
isFirstPrint = false;
}
System.out.print(reasoning);
}
if (Objects.nonNull(content) && !content.isEmpty()) {
Object text = content.get(0).get("text");
finalContent.append(content.get(0).get("text"));
if (!isFirstPrint) {
System.out.println("\n====================完全な応答====================");
isFirstPrint = true;
}
System.out.print(text);
}
}
public static MultiModalConversationParam buildMultiModalConversationParam(MultiModalMessage Msg) {
return MultiModalConversationParam.builder()
// 環境変数を設定していない場合は、次の行を Model Studio の API キーに置き換えてください: .apiKey("sk-xxx")
// API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
.model("qwen3-vl-plus")
.messages(Arrays.asList(Msg))
.enableThinking(true)
.thinkingBudget(81920)
.incrementalOutput(true)
.build();
}
public static void streamCallWithMessage(MultiModalConversation conv, MultiModalMessage Msg)
throws NoApiKeyException, ApiException, InputRequiredException, UploadFileException {
MultiModalConversationParam param = buildMultiModalConversationParam(Msg);
Flowable<MultiModalConversationResult> result = conv.streamCall(param);
result.blockingForEach(message -> {
handleGenerationResult(message);
});
}
public static void main(String[] args) {
try {
MultiModalConversation conv = new MultiModalConversation();
MultiModalMessage userMsg = MultiModalMessage.builder()
.role(Role.USER.getValue())
.content(Arrays.asList(Collections.singletonMap("image", "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"),
Collections.singletonMap("text", "この問題を解いてください")))
.build();
streamCallWithMessage(conv, userMsg);
// 最終結果を出力します
// if (reasoningContent.length() > 0) {
// System.out.println("\n====================完全な応答====================");
// System.out.println(finalContent.toString());
// }
} catch (ApiException | NoApiKeyException | UploadFileException | InputRequiredException e) {
logger.error("An exception occurred: {}", e.getMessage());
}
System.exit(0);
}
}# ======= 重要 =======
# API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
# 以下はシンガポールリージョンのベース URL です。米国 (バージニア) リージョンのモデルを使用している場合は、base_url を https://dashscope-us.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation に置き換えてください
# 北京リージョンのモデルを使用している場合は、base_url を https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation に置き換えてください
# === 実行前にこのコメントを削除してください ===
curl -X POST https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-H 'X-DashScope-SSE: enable' \
-d '{
"model": "qwen3-vl-plus",
"input":{
"messages":[
{
"role": "user",
"content": [
{"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
{"text": "この問題を解いてください"}
]
}
]
},
"parameters":{
"enable_thinking": true,
"incremental_output": true,
"thinking_budget": 81920
}
}'その他の例
視覚的推論モデルは、その推論能力に加えて、視覚理解モデルのすべての特徴を備えています。これらの特徴を組み合わせて、より複雑なシナリオに対応できます。
課金
総コスト = (入力トークン × トークンあたりの入力価格) + (出力トークン × トークンあたりの出力価格)。
思考プロセス (
reasoning_content) は出力コンテンツの一部であり、出力トークンとして課金されます。思考モードのモデルが思考プロセスを出力しない場合、非思考モードの価格で課金されます。画像または動画のトークン計算方法については、「視覚理解」をご参照ください。
API リファレンス
入出力パラメーターについては、「Qwen」をご参照ください。
エラーコード
呼び出しが失敗した場合は、「エラーメッセージ」でトラブルシューティングを行ってください。