すべてのプロダクト
Search
ドキュメントセンター

Alibaba Cloud Model Studio:データマイニング (Qwen-Doc-Turbo)

最終更新日:Jun 26, 2026

データマイニングモデルは、情報の抽出、コンテンツのモデレーション、データの分類、および要約の生成を行います。汎用チャットモデルが不整合なフォーマットを返したり、情報を誤って抽出したりする可能性があるのとは異なり、構造化データ (JSON など) を迅速かつ正確に出力します。

説明

このドキュメントは、中国 (北京) リージョンにのみ適用されます。モデルを使用するには、中国 (北京) リージョンの API キー を使用する必要があります。

実装ガイド

Qwen-Doc-Turbo は、3 つの方法でファイルから情報を抽出できます。ファイルサイズと種類の制限に関する詳細については、「制限事項」をご参照ください。

前提条件

ファイル URL を渡す方法

ファイル URL を使用して構造化データを抽出します (同時に最大 10 ファイル)。この例では、サンプル製品マニュアル Aサンプル製品マニュアル B ファイルを渡し、抽出された情報を JSON 形式で返すようにモデルにプロンプトを出します。

ファイル URL メソッドは DashScope プロトコルのみをサポートします。DashScope Python SDK または HTTP 呼び出し (curl など) を使用してください。
import os
import dashscope

# これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
dashscope.base_http_api_url = 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1'

response = dashscope.Generation.call(
    api_key=os.getenv('DASHSCOPE_API_KEY'), # 環境変数を設定していない場合は、ここを API キーに置き換えてください
    model='qwen-doc-turbo',
    messages=[
    {"role": "system","content": "You are a helpful assistant."},
    {
        "role": "user",
        "content": [
            {
                "type": "text",
                "text": "From these two product manuals, extract all product information and organize it into a standard JSON array. Each object must include the following: model (the product model), name (the product name), and price (the price, with currency symbols and commas removed)."
            },
            {
                "type": "doc_url",
                "doc_url": [
                    "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20251107/jockge/%E7%A4%BA%E4%BE%8B%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8CA.docx",
                    "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20251107/ztwxzr/%E7%A4%BA%E4%BE%8B%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8CB.docx"
                ],
                "file_parsing_strategy": "auto"
            }
        ]
    }]
)
try:
    if response.status_code == 200:
        print(response.output.choices[0].message.content)
    else:
        print(f"Request failed, status code: {response.status_code}")
        print(f"Error code: {response.code}")
        print(f"Error message: {response.message}")
        print("For more information, see https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
except Exception as e:
    print(f"An error occurred: {e}")
    print("For more information, see https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $DASHSCOPE_API_KEY' \
--header 'X-DashScope-SSE: enable' \
--data '{
    "model": "qwen-doc-turbo",
    "input": {
        "messages": [
                {
                    "role": "system",
                    "content": "you are a helpful assistant."
                },
                {
                    "role": "user",
                    "content": [
                        {
                            "type": "text",
                            "text": "From these two product manuals, extract all product information and organize it into a standard JSON array. Each object must include the following: model (the product model), name (the product name), and price (the price, with currency symbols and commas removed)."
                        },
                        {
                            "type": "doc_url",
                            "doc_url": [
                                "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20251107/jockge/%E7%A4%BA%E4%BE%8B%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8CA.docx",
                                "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20251107/ztwxzr/%E7%A4%BA%E4%BE%8B%E4%BA%A7%E5%93%81%E6%89%8B%E5%86%8CB.docx"
                            ],
                            "file_parsing_strategy": "auto"
                        }
                    ]
                }
            ]
    }
}'

応答例

[
  {
    "model": "PRO-100",
    "name": "Smart Printer",
    "price": "8999"
  },
  {
    "model": "PRO-200",
    "name": "Smart Scanner",
    "price": "12999"
  },
  ...
  {
    "model": "SEC-400",
    "name": "Smart Visitor System",
    "price": "9999"
  },
  {
    "model": "SEC-500",
    "name": "Smart Parking Management",
    "price": "22999"
  }
]

ファイル ID を渡す方法

ファイルのアップロード

コードを実行する前に、サンプル製品マニュアル A をダウンロードし、プロジェクトディレクトリに配置します。OpenAI 互換インターフェイス経由でファイルをアップロードして file-id を取得します。アップロード API の詳細については、「API リファレンス」をご参照ください。

Python

import os
from pathlib import Path
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),  # 環境変数を設定していない場合は、ここを API キーに置き換えてください
    # これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",  # DashScope サービスの base_url を入力してください
)

file_object = client.files.create(file=Path("Sample Product Manual A.docx"), purpose="file-extract")
# 後続のモデル呼び出しで使用するために file-id を出力します
print(file_object.id)

Java

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.files.*;

import java.nio.file.Paths;

public class Main {
    public static void main(String[] args) {
        // クライアントを作成し、環境変数から API キーを使用します
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
                .baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
                .build();
        // ファイルパスを設定します。必要に応じてパスとファイル名を変更してください。
        Path filePath = Paths.get("src/main/java/org/example/Sample Product Manual A.docx");
        // ファイルアップロードパラメーターを作成します
        FileCreateParams fileParams = FileCreateParams.builder()
                .file(filePath)
                .purpose(FilePurpose.of("file-extract"))
                .build();

        // ファイルをアップロードし、file-id を出力します
        FileObject fileObject = client.files().create(fileParams);
        // 後続のモデル呼び出しで使用するために file-id を出力します
        System.out.println(fileObject.id());
    }
}

curl

curl --location --request POST 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/files' \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --form 'file=@"Sample Product Manual A.docx"' \
  --form 'purpose="file-extract"'

コードを実行して、アップロードされたファイルの file-id を取得します。

ファイル ID を使用した情報の受け渡しと対話の開始

システムメッセージ (ロール設定メッセージの後) で file-id を渡します。ユーザーメッセージには、ファイルに関するクエリが含まれます。

import os
from openai import OpenAI, BadRequestError

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"), # 環境変数を設定していない場合は、ここを API キーに置き換えてください
    # これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)

try:
    completion = client.chat.completions.create(
        model="qwen-doc-turbo",
        messages=[
            {'role': 'system', 'content': 'You are a helpful assistant.'},
            # '{FILE_ID}' を実際のシナリオの file-id に置き換えてください
            {'role': 'system', 'content': 'fileid://{FILE_ID}'},
            {'role': 'user', 'content': 'From this product manual, extract all product information and organize it into a standard JSON array. Each object must include the following: model (the product model), name (the product name), and price (the price, with currency symbols and commas removed).'}
        ],
        # このコード例では、モデルの出力プロセスを明確に示すためにストリーミング出力を使用しています。非ストリーミング出力の例については、https://www.alibabacloud.com/help/model-studio/user-guide/text-generation をご参照ください
        stream=True,
        stream_options={"include_usage": True}
    )

    full_content = ""
    for chunk in completion:
        if chunk.choices and chunk.choices[0].delta.content:
            full_content += chunk.choices[0].delta.content
            print(chunk.model_dump())
    
    print(full_content)

except BadRequestError as e:
    print(f"Error message: {e}")
    print("For more information, see https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.http.StreamResponse;
import com.openai.models.chat.completions.*;

public class Main {
    public static void main(String[] args) {
        // クライアントを作成し、環境変数から API キーを使用します
        OpenAIClient client = OpenAIOkHttpClient.builder()
                // 環境変数を設定していない場合は、次の行を Model Studio API キーに置き換えてください: .apiKey("sk-xxx");
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
                .baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
                .build();

        ChatCompletionCreateParams chatParams = ChatCompletionCreateParams.builder()
                .addSystemMessage("You are a helpful assistant.")
                // '{FILE_ID}' を実際のシナリオの file-id に置き換えてください
                .addSystemMessage("fileid://{FILE_ID}")
                .addUserMessage("From this product manual, extract all product information and organize it into a standard JSON array. Each object must include the following: model (the product model), name (the product name), and price (the price, with currency symbols and commas removed).")
                .model("qwen-doc-turbo")
                .build();

        try (StreamResponse<ChatCompletionChunk> streamResponse = client.chat().completions().createStreaming(chatParams)) {
            streamResponse.stream().forEach(chunk -> {
                String content = chunk.choices().get(0).delta().content().orElse("");
                if (!content.isEmpty()) {
                    System.out.print(content);
                }
            });
        } catch (Exception e) {
            System.err.println("Error message: " + e.getMessage());
        }
    }
# これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
}
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
    "model": "qwen-doc-turbo",
    "messages": [
        {"role": "system","content": "You are a helpful assistant."},
        {"role": "system","content": "fileid://{FILE_ID}"},
        {"role": "user","content": "From this product manual, extract all product information and organize it into a standard JSON array. Each object must include the following: model (the product model), name (the product name), and price (the price, with currency symbols and commas removed)."}
    ],
    "stream": true,
    "stream_options": {
        "include_usage": true
    }
}'

完全な例:ファイルのアップロードとモデルの呼び出し

import os
import time
from pathlib import Path
from openai import OpenAI, BadRequestError

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),  # 環境変数を設定していない場合は、ここを API キーに置き換えてください
    # これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)

try:
    # ステップ 1: ファイルのアップロード
    file_object = client.files.create(file=Path("Sample Product Manual A.docx"), purpose="file-extract")
    file_id = file_object.id
    print(f"ファイルが正常にアップロードされました。file-id: {file_id}")
    
    # ステップ 2: ファイルの解析が完了するのを待機します (オプション、大きなファイルの場合に必要になることがあります)
    # ファイルがまだ解析中の場合、API はエラーを返します。リトライする必要があります。
    max_retries = 10
    retry_count = 0
    
    while retry_count < max_retries:
        try:
            # ステップ 3: file-id を使用してモデルを呼び出す
            completion = client.chat.completions.create(
                model="qwen-doc-turbo",
                messages=[
                    {'role': 'system', 'content': 'You are a helpful assistant.'},
                    {'role': 'system', 'content': f'fileid://{file_id}'},
                    {'role': 'user', 'content': 'From this product manual, extract all product information and organize it into a standard JSON array. Each object must include the following: model (the product model), name (the product name), and price (the price, with currency symbols and commas removed).'}
                ],
                stream=True,
                stream_options={"include_usage": True}
            )
            
            # ステップ 4: モデルの出力を処理する
            full_content = ""
            for chunk in completion:
                if chunk.choices and chunk.choices[0].delta.content:
                    full_content += chunk.choices[0].delta.content
                    print(chunk.choices[0].delta.content, end='', flush=True)
            
            print(f"\n\n完全な出力:\n{full_content}")
            break
            
        except BadRequestError as e:
            if "File parsing in progress" in str(e):
                retry_count += 1
                print(f"ファイルは解析中です。遅延後にリトライします ({retry_count}/{max_retries})...")
                time.sleep(2)  # 2 秒待機してリトライします
            else:
                raise e
    
    if retry_count >= max_retries:
        print("ファイルの解析がタイムアウトしました。後でもう一度お試しください。")

except BadRequestError as e:
    print(f"エラーメッセージ: {e}")
    print("For more information, see https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
except Exception as e:
    print(f"An error occurred: {e}")
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.http.StreamResponse;
import com.openai.models.chat.completions.*;
import com.openai.models.files.*;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.concurrent.TimeUnit;

public class Main {
    public static void main(String[] args) {
        // クライアントを作成します
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
                .baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
                .build();
        
        try {
            // ステップ 1: ファイルのアップロード
            Path filePath = Paths.get("src/main/java/org/example/Sample Product Manual A.docx");
            FileCreateParams fileParams = FileCreateParams.builder()
                    .file(filePath)
                    .purpose(FilePurpose.of("file-extract"))
                    .build();
            
            FileObject fileObject = client.files().create(fileParams);
            String fileId = fileObject.id();
            System.out.println("ファイルが正常にアップロードされました。file-id: " + fileId);
            
            // ステップ 2: ファイルの解析を待ってからモデルを呼び出します (最大 10 回リトライ)
            int maxRetries = 10;
            int retryCount = 0;
            boolean success = false;
            
            while (retryCount < maxRetries && !success) {
                try {
                    // ステップ 3: file-id を使用してモデルを呼び出す
                    ChatCompletionCreateParams chatParams = ChatCompletionCreateParams.builder()
                            .addSystemMessage("You are a helpful assistant.")
                            .addSystemMessage("fileid://" + fileId)
                            .addUserMessage("From this product manual, extract all product information and organize it into a standard JSON array. Each object must include the following: model (the product model), name (the product name), and price (the price, with currency symbols and commas removed).")
                            .model("qwen-doc-turbo")
                            .build();
                    
                    // ステップ 4: モデルの出力を処理する
                    try (StreamResponse<ChatCompletionChunk> streamResponse = 
                            client.chat().completions().createStreaming(chatParams)) {
                        streamResponse.stream().forEach(chunk -> {
                            String content = chunk.choices().get(0).delta().content().orElse("");
                            if (!content.isEmpty()) {
                                System.out.print(content);
                            }
                        });
                        System.out.println();
                        success = true;
                    }
                    
                } catch (Exception e) {
                    if (e.getMessage() != null && e.getMessage().contains("File parsing in progress")) {
                        retryCount++;
                        System.out.println("ファイルは解析中です。遅延後にリトライします (" + retryCount + "/" + maxRetries + ")...");
                        TimeUnit.SECONDS.sleep(2);  // 2 秒待機してリトライします
                    } else {
                        throw e;
                    }
                }
            }
            
            if (!success) {
                System.out.println("ファイルの解析がタイムアウトしました。後でもう一度お試しください。");
            }
            
        } catch (Exception e) {
            System.err.println("エラーメッセージ: " + e.getMessage());
            e.printStackTrace();
        }
    }
}

応答例

[
  {
    "model": "PRO-100",
    "name": "Smart Printer",
    "price": "8999"
  },
  {
    "model": "PRO-200",
    "name": "Smart Scanner",
    "price": "12999"
  },
  ...
  {
    "model": "SEC-400",
    "name": "Smart Visitor System",
    "price": "9999"
  },
  {
    "model": "SEC-500",
    "name": "Smart Parking Management",
    "price": "22999"
  }
]

プレーンテキストを渡す方法

file-id を使用する代わりに、ファイルの内容を文字列として直接渡すことができます。混乱を避けるために、messages 配列の最初にロール設定メッセージを配置してください。

テキストコンテンツが 9,000 トークンを超える場合は、(API ボディサイズの制限により) 代わりにファイル URL またはファイル ID を使用してください。
import os
from openai import OpenAI, BadRequestError

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"), # 環境変数を設定していない場合は、ここを API キーに置き換えてください
    # これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)

try:
    completion = client.chat.completions.create(
        model="qwen-doc-turbo",
        messages=[
            {'role': 'system', 'content': 'You are a helpful assistant.'},
            {'role': 'system', 'content': 'Smart Office Product Manual Version: V2.0 Release Date: January 2024 Table of Contents 1.1 Product Overview...'},
            {'role': 'user', 'content': 'From this product manual, extract all product information and organize it into a standard JSON array. Each object must include the following: model (the product model), name (the product name), and price (the price, with currency symbols and commas removed).'}
        ],
        # このコード例では、モデルの出力プロセスを明確に示すためにストリーミング出力を使用しています。非ストリーミング出力の例については、https://www.alibabacloud.com/help/model-studio/user-guide/text-generation をご参照ください
        stream=True,
        stream_options={"include_usage": True}
    )

    full_content = ""
    for chunk in completion:
        if chunk.choices and chunk.choices[0].delta.content:
            full_content += chunk.choices[0].delta.content
            print(chunk.model_dump())
    
    print(full_content)

except BadRequestError as e:
    print(f"エラーメッセージ: {e}")
    print("For more information, see https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.http.StreamResponse;
import com.openai.models.chat.completions.*;

public class Main {
    public static void main(String[] args) {
        // クライアントを作成し、環境変数から API キーを使用します
        OpenAIClient client = OpenAIOkHttpClient.builder()
                // 環境変数を設定していない場合は、次の行を Model Studio API キーに置き換えてください: .apiKey("sk-xxx");
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
                .baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
                .build();

        ChatCompletionCreateParams chatParams = ChatCompletionCreateParams.builder()
                .addSystemMessage("You are a helpful assistant.")
                .addSystemMessage("Smart Office Product Manual Version: V2.0 Release Date: January 2024 Table of Contents 1.1 Product Overview...")
                .addUserMessage("From this product manual, extract all product information and organize it into a standard JSON array. Each object must include the following: model (the product model), name (the product name), and price (the price, with currency symbols and commas removed).")
                .model("qwen-doc-turbo")
                .build();

        try (StreamResponse<ChatCompletionChunk> streamResponse = client.chat().completions().createStreaming(chatParams)) {
            streamResponse.stream().forEach(chunk -> {
                String content = chunk.choices().get(0).delta().content().orElse("");
                if (!content.isEmpty()) {
                    System.out.print(content);
                }
            });
        } catch (Exception e) {
            System.err.println("Error message: " + e.getMessage());
        }
    }
# これは、中国北部 2 (北京) リージョンの URL です。リージョンごとに URL は異なります。
}
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
    "model": "qwen-doc-turbo",
    "messages": [
        {"role": "system","content": "You are a helpful assistant."},
        {"role": "system","content": "Smart Office Product Manual Version: V2.0 Release Date: January 2024 Table of Contents 1.1 Product Overview..."},
        {"role": "user","content": "From this product manual, extract all product information and organize it into a standard JSON array. Each object must include the following: model (the product model), name (the product name), and price (the price, with currency symbols and commas removed)."}
    ],
    "stream": true,
    "stream_options": {
        "include_usage": true
    }
}'

応答例

[
  {
    "model": "PRO-100",
    "name": "Smart Printer",
    "price": "8999"
  },
  {
    "model": "PRO-200",
    "name": "Smart Scanner",
    "price": "12999"
  },
  ...
  {
    "model": "SEC-400",
    "name": "Smart Visitor System",
    "price": "9999"
  },
  {
    "model": "SEC-500",
    "name": "Smart Parking Management",
    "price": "22999"
  }
]

モデルの料金

機能

ファイル URL (推奨)

ファイル ID

プレーンテキスト

ファイルソース

パブリック URL

ローカルファイル (アップロードが必要)

文字列として渡す

入力長制限

最大 10 ファイル
大容量ファイルに対応 (最大入力 253k トークン)



























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































<-p>

1 ファイル
大容量ファイルに対応 (最大入力 253k トークン)



















































































































































































































































































































































































































































































































































































































































































































































































































































































































最大 9,000 トークン

SDK 互換性

DashScope のみ

アップロード: OpenAI
呼び出し: OpenAI および DashScope












































































































































































































































































































































































































































































































































































































































OpenAI および DashScope

主な利点

Model Studio へのアップロードは不要です。バッチ呼び出しをサポートします。

繰り返しのアップロードを回避します。再利用に最適です。

ファイル管理は不要です。

モデル

コンテキストウィンドウ

最大入力

最大出力

入力コスト

出力コスト

無料クォータ

(トークン)

(百万トークン)

qwen-doc-turbo

262,144

253,952

32,768

0.087 ドル

0.144 ドル

無料クォータなし

よくある質問

  1. OpenAI 互換ファイルインターフェイスを介してアップロードされたファイルはどこに保存されますか?

    OpenAI 互換インターフェイス経由でアップロードされたファイルは、ご利用の Model Studio バケットに無料で保存されます。ファイルのクエリと管理については、「OpenAI ファイルインターフェイス」をご参照ください。

  2. ファイル URL メソッドを使用してアップロードする場合、file_parsing_strategy パラメーターのオプションにはどのような違いがありますか?

    "auto":コンテンツに基づいて自動的に解析します。"text_only":テキストのみを解析します。"text_and_images":イメージとテキストの両方を解析します (解析時間が増加します)。

  3. ファイルの解析が完了したかどうかは、どのように判断できますか?

    ファイル ID を使用して会話を開始してみてください。ファイルがまだ解析中の場合、API は File parsing in progress, please try again later. を返します。この場合は、少し時間をおいてからリトライしてください。呼び出しが成功した場合、ファイルの準備は完了です。

  4. ファイルアップロード後の解析プロセスで追加費用は発生しますか?

    ドキュメント解析は無料です。

API リファレンス

Qwen-Doc-Turbo の入力および出力パラメーターについては、OpenAI 互換 API リファレンスまたはDashScope API リファレンスをご参照ください。

エラーコード

モデルの呼び出しが失敗し、エラーメッセージが返された場合は、エラーコードをご参照ください。

制限事項

  • SDK の依存関係:

    • ファイル URL (doc_url):DashScope プロトコルのみをサポートします。DashScope Python SDK または HTTP 呼び出し (curl など) を使用してください。

    • ファイルのアップロード (file-id):アップロードと管理には、OpenAI 互換の SDK を使用する必要があります。

  • ファイルのアップロードと参照:

    • ファイル URL (doc_url):リクエストごとに最大 10 個の URL を指定できます。URL はパブリックにアクセス可能である必要があります。

    • ファイルのアップロード (file-id):ファイルあたり最大 150 MB。アカウントの制限:合計 10,000 ファイルまたは 100 GB (ファイルの有効期限は切れません)。各リクエストで参照できるファイルは 1 つだけです。

      制限に達すると、アップロードリクエストは失敗します。不要なファイルを削除して、無料クォータを解放してください。詳細については、「OpenAI 互換 - ファイル」をご参照ください。
    • サポートされているフォーマット:TXT、DOC、DOCX、PDF、XLS、XLSX、MD、PPT、PPTX、JPG、JPEG、PNG、GIF、BMP。

  • API 入力:

    • doc_url または file-id を使用する場合:最大 262,144 トークン。

    • user / system メッセージ内のプレーンテキスト:メッセージあたり最大 9,000 トークン。

  • API 出力:

    • 最大出力長は 32,768 トークンです。

  • ファイル共有:

    • file-id は、生成元のアカウント内でのみ機能します。アカウント間や RAM ユーザーの API キーでは機能しません。

  • レート制限:詳細については、「レート制限」をご参照ください。