All Products
Search
Document Center

Alibaba Cloud Model Studio:Penambangan data (Qwen-Doc-Turbo)

Last Updated:Jun 26, 2026

Model penambangan data mengekstraksi informasi, memoderasi konten, mengklasifikasikan data, dan menghasilkan ringkasan. Model ini menghasilkan data terstruktur (seperti JSON) secara cepat dan akurat, berbeda dengan model chat umum yang mungkin mengembalikan format tidak konsisten atau mengekstraksi informasi secara salah.

Catatan

Dokumen ini hanya berlaku untuk wilayah China (Beijing). Untuk menggunakan model ini, Anda harus menggunakan API key dari wilayah China (Beijing).

Panduan implementasi

Qwen-Doc-Turbo mendukung ekstraksi informasi dari file melalui tiga cara. Untuk informasi lebih lanjut mengenai batasan ukuran dan jenis file, lihat Batasan.

Fitur

File URL (Direkomendasikan)

ID File

Teks biasa

Sumber file

URL publik

File lokal (perlu diupload)

Diteruskan sebagai string

Batas panjang input

Hingga 10 file
Mendukung file besar (input maksimum 253k token)

























































































































































































































































tags preserved in actual output)

1 file
Mendukung file besar (input maksimum 253.000 token)

Hingga 9.000 token

Kompatibilitas SDK

Hanya DashScope

Upload: OpenAI
Panggil: OpenAI dan DashScope

OpenAI dan DashScope

Keunggulan utama

Tidak perlu upload ke Model Studio. Mendukung panggilan batch.

Menghindari upload berulang. Ideal untuk penggunaan ulang.

Tidak memerlukan manajemen file.

Prasyarat

Gunakan URL file

Ekstrak data terstruktur menggunakan URL file (hingga 10 file sekaligus). Contoh ini meneruskan file Manual Produk Contoh A dan Manual Produk Contoh B, lalu meminta model mengembalikan informasi yang diekstraksi dalam format JSON.

Metode URL file hanya mendukung protokol DashScope. Gunakan DashScope Python SDK atau panggilan HTTP (seperti curl).
import os
import dashscope

# URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
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'), # Jika Anda belum menyetel variabel lingkungan, ganti ini dengan API key Anda
    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/en/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/en/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"
                        }
                    ]
                }
            ]
    }
}'

Contoh respons

[
  {
    "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"
  }
]

Gunakan ID file

Upload file

Sebelum menjalankan kode, unduh Manual Produk Contoh A dan letakkan di direktori proyek Anda. Upload file melalui antarmuka kompatibel OpenAI untuk mendapatkan file-id. Untuk detail API upload, lihat Referensi API.

Python

import os
from pathlib import Path
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),  # Jika Anda belum menyetel variabel lingkungan, ganti ini dengan API key Anda
    # URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",  # Masukkan base_url layanan DashScope
)

file_object = client.files.create(file=Path("Sample Product Manual A.docx"), purpose="file-extract")
# Cetak file-id untuk digunakan dalam pemanggilan model selanjutnya
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) {
        // Buat klien dan gunakan API key dari variabel lingkungan
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
                .baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
                .build();
        // Atur path file. Sesuaikan path dan nama file sesuai kebutuhan.
        Path filePath = Paths.get("src/main/java/org/example/Sample Product Manual A.docx");
        // Buat parameter upload file
        FileCreateParams fileParams = FileCreateParams.builder()
                .file(filePath)
                .purpose(FilePurpose.of("file-extract"))
                .build();

        // Upload file dan cetak file-id
        FileObject fileObject = client.files().create(fileParams);
        // Cetak file-id untuk digunakan dalam pemanggilan model selanjutnya
        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"'

Jalankan kode untuk mendapatkan file-id dari file yang diupload.

Teruskan informasi dan mulai percakapan menggunakan ID file

Teruskan file-id dalam pesan system (setelah pesan pengaturan role). Pesan user berisi kueri Anda tentang file tersebut.

import os
from openai import OpenAI, BadRequestError

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"), # Jika Anda belum menyetel variabel lingkungan, ganti ini dengan API key Anda
    # URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
    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.'},
            # Ganti '{FILE_ID}' dengan file-id dari skenario Anda
            {'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).'}
        ],
        # Contoh kode ini menggunakan keluaran streaming untuk menunjukkan proses output model secara jelas. Untuk contoh keluaran non-streaming, lihat https://www.alibabacloud.com/help/en/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/en/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) {
        // Buat klien dan gunakan API key dari variabel lingkungan
        OpenAIClient client = OpenAIOkHttpClient.builder()
                // Jika Anda belum menyetel variabel lingkungan, ganti baris berikut dengan Kunci API Studio Model Anda: .apiKey("sk-xxx");
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
                .baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
                .build();

        ChatCompletionCreateParams chatParams = ChatCompletionCreateParams.builder()
                .addSystemMessage("You are a helpful assistant.")
                // Ganti '{FILE_ID}' dengan file-id dari skenario Anda
                .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());
        }
    }
# URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
}
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
    }
}'

Contoh lengkap: Upload file dan panggil model

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

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),  # Jika Anda belum menyetel variabel lingkungan, ganti ini dengan API key Anda
    # URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)

try:
    # Langkah 1: Upload file
    file_object = client.files.create(file=Path("Sample Product Manual A.docx"), purpose="file-extract")
    file_id = file_object.id
    print(f"File uploaded successfully. file-id: {file_id}")
    
    # Langkah 2: Tunggu hingga parsing file selesai (opsional, mungkin diperlukan untuk file besar)
    # Jika file masih dalam proses parsing, API akan mengembalikan error. Anda harus mencoba lagi.
    max_retries = 10
    retry_count = 0
    
    while retry_count < max_retries:
        try:
            # Langkah 3: Panggil model menggunakan 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}
            )
            
            # Langkah 4: Proses output model
            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\nFull output:\n{full_content}")
            break
            
        except BadRequestError as e:
            if "File parsing in progress" in str(e):
                retry_count += 1
                print(f"File is parsing. Retrying after a delay ({retry_count}/{max_retries})...")
                time.sleep(2)  # Tunggu 2 detik lalu coba lagi
            else:
                raise e
    
    if retry_count >= max_retries:
        print("File parsing timed out. Try again later.")

except BadRequestError as e:
    print(f"Error message: {e}")
    print("For more information, see https://www.alibabacloud.com/help/en/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) {
        // Buat klien
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
                .baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
                .build();
        
        try {
            // Langkah 1: Upload file
            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 uploaded successfully. file-id: " + fileId);
            
            // Langkah 2: Tunggu hingga parsing file selesai lalu panggil model (maksimal 10 kali percobaan)
            int maxRetries = 10;
            int retryCount = 0;
            boolean success = false;
            
            while (retryCount < maxRetries && !success) {
                try {
                    // Langkah 3: Panggil model menggunakan 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();
                    
                    // Langkah 4: Proses output model
                    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("File is parsing. Retrying after a delay (" + retryCount + "/" + maxRetries + ")...");
                        TimeUnit.SECONDS.sleep(2);  // Tunggu 2 detik lalu coba lagi
                    } else {
                        throw e;
                    }
                }
            }
            
            if (!success) {
                System.out.println("File parsing timed out. Try again later.");
            }
            
        } catch (Exception e) {
            System.err.println("Error message: " + e.getMessage());
            e.printStackTrace();
        }
    }
}

Contoh respons

[
  {
    "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"
  }
]

Gunakan teks biasa

Anda dapat meneruskan konten file langsung sebagai string alih-alih menggunakan file-id. Untuk menghindari kebingungan, letakkan pesan pengaturan role terlebih dahulu dalam array messages.

Jika konten teks melebihi 9.000 token, gunakan URL file atau ID file sebagai gantinya (karena batasan ukuran body API).
import os
from openai import OpenAI, BadRequestError

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"), # Jika Anda belum menyetel variabel lingkungan, ganti ini dengan API key Anda
    # URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
    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).'}
        ],
        # Contoh kode ini menggunakan keluaran streaming untuk menunjukkan proses output model secara jelas. Untuk contoh keluaran non-streaming, lihat https://www.alibabacloud.com/help/en/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/en/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) {
        // Buat klien dan gunakan API key dari variabel lingkungan
        OpenAIClient client = OpenAIOkHttpClient.builder()
                // Jika Anda belum menyetel variabel lingkungan, ganti baris berikut dengan Kunci API Studio Model Anda: .apiKey("sk-xxx");
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
                .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());
        }
    }
# URL berikut berlaku untuk wilayah China North 2 (Beijing); URL berbeda untuk wilayah lain.
}
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
    }
}'

Contoh respons

[
  {
    "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"
  }
]

Harga model

Model

Jendela konteks

Input maks

Output maks

Biaya input

Biaya output

Kuota gratis

(Token)

(Juta token)

qwen-doc-turbo

262.144

253.952

32.768

$0,087

$0,144

Tidak ada kuota gratis

FAQ

  1. Di mana file disimpan setelah diupload melalui antarmuka file kompatibel OpenAI?

    File yang diupload melalui antarmuka kompatibel OpenAI disimpan gratis di bucket Model Studio Anda. Untuk menanyakan dan mengelola file, lihat Antarmuka file OpenAI.

  2. Saat mengupload menggunakan metode URL file, apa perbedaan antara opsi parameter file_parsing_strategy?

    "auto": secara otomatis mengurai berdasarkan konten. "text_only": hanya mengurai teks. "text_and_images": mengurai teks dan gambar (meningkatkan waktu penguraian).

  3. Bagaimana cara mengetahui apakah file telah selesai diurai?

    Coba mulai percakapan dengan ID file tersebut. Jika file masih dalam proses penguraian, API akan mengembalikan File parsing in progress, please try again later. — coba lagi setelah jeda. Jika pemanggilan berhasil, file sudah siap.

  4. Apakah proses penguraian setelah upload file dikenai biaya tambahan?

    Penguraian dokumen tidak dikenai biaya.

Referensi API

Untuk parameter input dan output Qwen-Doc-Turbo, lihat Referensi API kompatibel OpenAI atau Referensi API DashScope.

Kode error

Jika pemanggilan model gagal dan mengembalikan pesan error, lihat Kode error untuk penyelesaian.

Batasan

  • Ketergantungan SDK:

    • URL File (doc_url): Hanya mendukung protokol DashScope. Gunakan DashScope Python SDK atau panggilan HTTP (seperti curl).

    • Upload file (file-id): Harus menggunakan SDK kompatibel OpenAI untuk upload dan manajemen.

  • Upload dan referensi file:

    • URL File (doc_url): Maksimal 10 URL per permintaan. URL harus dapat diakses publik.

    • Upload file (file-id): Maksimal 150 MB per file. Batas akun: 10.000 file atau total 100 GB (file tidak pernah kedaluwarsa). Setiap permintaan hanya mereferensikan satu file.

      Permintaan upload gagal jika batas tercapai. Hapus file yang tidak diperlukan untuk membebaskan kuota. Lihat Kompatibel OpenAI - File untuk detailnya.
    • Format yang didukung: TXT, DOC, DOCX, PDF, XLS, XLSX, MD, PPT, PPTX, JPG, JPEG, PNG, GIF, dan BMP.

  • API Input:

    • Menggunakan doc_url atau file-id: maksimal 262.144 token.

    • Teks biasa dalam pesan user/system: maksimal 9.000 token per pesan.

  • Output API:

    • Panjang output maksimum adalah 32.768 token.

  • Berbagi file:

    • file-id hanya berfungsi dalam akun yang menghasilkannya — tidak berlaku lintas akun atau dengan kunci API pengguna RAM.

  • Batas laju: Lihat Pembatasan laju.