Todos los productos
Search
Centro de documentos

Alibaba Cloud Model Studio:Minería de datos (Qwen-Doc-Turbo)

Última actualización: Oct 12, 2026

El modelo de minería de datos extrae información, modera contenido, clasifica datos y genera resúmenes. Produce datos estructurados (como JSON) de forma rápida y precisa, a diferencia de los modelos de chat de propósito general que pueden devolver formatos inconsistentes o extraer información incorrectamente.

NotaEste documento se aplica únicamente a la región China (Pekín). Para utilizar el modelo, debe usar una clave de API de la región China (Pekín).

Guía de implementación

Qwen-Doc-Turbo admite la extracción de información de archivos de tres maneras. Para obtener más información sobre los límites de tamaño y tipo de archivo, consulte Limitaciones.

Función

URL de archivo (Recomendado)

ID de archivo

Texto sin formato

Origen del archivo

URL pública

Archivo local (se requiere carga)

Pasado como cadena

Límite de longitud de entrada

Hasta 10 archivos
Admite archivos grandes (entrada máx. de 253k tokens)

1 archivo
Admite archivos grandes (entrada máx. de 253k tokens)

Hasta 9,000 tokens

Compatibilidad con SDK

Solo DashScope

Carga: OpenAI
Llamada: OpenAI y DashScope

OpenAI y DashScope

Ventajas clave

No se requiere carga en Model Studio. Admite llamadas por lotes.

Evita cargas repetidas. Ideal para reutilización.

No se requiere gestión de archivos.

Requisitos previos

Pasar una URL de archivo

Extraiga datos estructurados mediante URLs de archivos (hasta 10 archivos simultáneamente). Este ejemplo pasa los archivos Manual de producto de muestra A y Manual de producto de muestra B e indica al modelo que devuelva la información extraída en formato JSON.

El método de URL de archivo solo admite el protocolo DashScope. Utilice el SDK de Python de DashScope o llamadas HTTP (como curl).

import os
import dashscope

# The following is the base_url for the Beijing region.
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'), # If you have not set the environment variable, replace this with your API key
    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"
                        }
                    ]
                }
            ]
    }
}'

NotaEl modelo devuelve los datos extraídos como una matriz JSON en el campo content. Tenga en cuenta que el contenido puede estar envuelto en marcadores de bloque de código markdown (por ejemplo, ```json\n[...]\n```). Debe eliminar estos marcadores markdown antes de analizar la respuesta con json.loads():

content = response.output.choices[0].message.content
# Strip markdown code block markers if present
if content.startswith("```"):
    # Remove opening ```json or ``` marker
    content = content.split("\n", 1)[1] if "\n" in content else content[3:]
    # Remove closing ``` marker
    if content.endswith("```"):
        content = content[:-3]
    content = content.strip()
data = json.loads(content)

Ejemplo de respuesta

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

Pasar un ID de archivo

Cargar un archivo

Antes de ejecutar el código, descargue el Manual de producto de muestra A y colóquelo en el directorio de su proyecto. Cargue el archivo a través de la interfaz compatible con OpenAI para obtener un file-id. Para obtener detalles sobre la API de carga, consulte la Referencia de API.

import os
from pathlib import Path
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),  # If you have not set the environment variable, replace this with your API key
    # The following is the base_url for the Beijing region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",  # Enter the DashScope service base_url
)

file_object = client.files.create(file=Path("Sample Product Manual A.docx"), purpose="file-extract")
# Print the file-id for use in subsequent model calls
print(file_object.id)
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) {
        // Create a client and use the API key from the environment variable
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // The following is the base_url for the Beijing region.
                .baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
                .build();
        // Set the file path. Modify the path and filename as needed.
        Path filePath = Paths.get("src/main/java/org/example/Sample Product Manual A.docx");
        // Create file upload parameters
        FileCreateParams fileParams = FileCreateParams.builder()
                .file(filePath)
                .purpose(FilePurpose.of("file-extract"))
                .build();

        // Upload the file and print the file-id
        FileObject fileObject = client.files().create(fileParams);
        // Print the file-id for use in subsequent model calls
        System.out.println(fileObject.id());
    }
}
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"'

Ejecute el código para obtener el file-id del archivo cargado.

Pasar información e iniciar una conversación mediante un ID de archivo

Pase el file-id en un mensaje del sistema (después del mensaje de configuración de rol). El mensaje del usuario contiene su consulta sobre el archivo.

import os
from openai import OpenAI, BadRequestError

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"), # If you have not set the environment variable, replace this with your API key
    # The following is the base_url for the Beijing region.
    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.'},
            # Replace '{FILE_ID}' with the file-id from your scenario
            {'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).'}
        ],
        # This code example uses streaming output to clearly show the model's output process. For non-streaming output examples, see 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) {
        // Create a client and use the API key from the environment variable
        OpenAIClient client = OpenAIOkHttpClient.builder()
                // If you have not set the environment variable, replace the next line with your Model Studio API key: .apiKey("sk-xxx");
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // The following is the base_url for the Beijing region.
                .baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
                .build();

        ChatCompletionCreateParams chatParams = ChatCompletionCreateParams.builder()
                .addSystemMessage("You are a helpful assistant.")
                // Replace '{FILE_ID}' with the file-id from your scenario
                .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());
        }
    }
# The following is the base_url for the Beijing region.
}
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
    }
}'

Ejemplo completo: Cargar un archivo y llamar al modelo

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

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),  # If you have not set the environment variable, replace this with your API key
    # The following is the base_url for the Beijing region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)

try:
    # Step 1: Upload the 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}")

    # Step 2: Wait for the file to finish parsing (optional, may be needed for large files)
    # If the file is still parsing, the API returns an error. You must retry.
    max_retries = 10
    retry_count = 0

    while retry_count < max_retries:
        try:
            # Step 3: Call the model using the 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}
            )

            # Step 4: Process the model output
            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)  # Wait 2 seconds and retry
            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/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) {
        // Create a client
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // The following is the base_url for the Beijing region.
                .baseUrl("https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1")
                .build();

        try {
            // Step 1: Upload the 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);

            // Step 2: Wait for the file to parse and then call the model (max 10 retries)
            int maxRetries = 10;
            int retryCount = 0;
            boolean success = false;

            while (retryCount < maxRetries && !success) {
                try {
                    // Step 3: Call the model using the 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();

                    // Step 4: Process the model output
                    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);  // Wait 2 seconds and retry
                    } 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();
        }
    }
}

NotaEl modelo devuelve los datos extraídos como una matriz JSON en el campo content. Tenga en cuenta que el contenido puede estar envuelto en marcadores de bloque de código markdown (por ejemplo, ```json\n[...]\n```). Debe eliminar estos marcadores markdown antes de analizar la respuesta con json.loads():

content = response.output.choices[0].message.content
# Strip markdown code block markers if present
if content.startswith("```"):
    # Remove opening ```json or ``` marker
    content = content.split("\n", 1)[1] if "\n" in content else content[3:]
    # Remove closing ``` marker
    if content.endswith("```"):
        content = content[:-3]
    content = content.strip()
data = json.loads(content)

Respuesta de ejemplo

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

Pasar texto sin formato

Puede pasar el contenido del archivo directamente como una cadena en lugar de utilizar un file-id. Para evitar confusiones, coloque el mensaje de configuración de rol primero en la matriz messages.

Si el contenido de texto supera los 9,000 tokens, utilice una URL de archivo o un ID de archivo en su lugar (debido a los límites de tamaño del cuerpo de la API).

import os
from openai import OpenAI, BadRequestError

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"), # If you have not set the environment variable, replace this with your API key
    # The following is the base_url for the Beijing region.
    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).'}
        ],
        # This code example uses streaming output to clearly show the model's output process. For non-streaming output examples, see 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) {
        // Create a client and use the API key from the environment variable
        OpenAIClient client = OpenAIOkHttpClient.builder()
                // If you have not set the environment variable, replace the next line with your Model Studio API key: .apiKey("sk-xxx");
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                // The following is the base_url for the Beijing region.
                .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());
        }
    }
# The following is the base_url for the Beijing region.
}
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
    }
}'

NotaEl modelo devuelve los datos extraídos como una matriz JSON en el campo content. Tenga en cuenta que el contenido puede estar envuelto en marcadores de bloque de código markdown (por ejemplo, ```json\n[...]\n```). Debe eliminar estos marcadores markdown antes de analizar la respuesta con json.loads():

content = response.output.choices[0].message.content
# Strip markdown code block markers if present
if content.startswith("```"):
    # Remove opening ```json or ``` marker
    content = content.split("\n", 1)[1] if "\n" in content else content[3:]
    # Remove closing ``` marker
    if content.endswith("```"):
        content = content[:-3]
    content = content.strip()
data = json.loads(content)

Ejemplo de respuesta

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

Precios del modelo

Modelo

Ventana de contexto

Entrada máxima

Salida máxima

Costo de entrada

Costo de salida

Cuota gratuita

(Tokens)

(Millones de tokens)

qwen-doc-turbo

262,144

253,952

32,768

$0.087

$0.144

Sin cuota gratuita

FAQ

  1. ¿Dónde se almacenan los archivos después de cargarse a través de la interfaz de archivos compatible con OpenAI?

    Los archivos cargados a través de la interfaz compatible con OpenAI se almacenan gratuitamente en su bucket de Model Studio. Para consultar y gestionar archivos, consulte la Interfaz de archivos de OpenAI.

  2. Al cargar mediante el método de URL de archivo, ¿cuáles son las diferencias entre las opciones del parámetro file_parsing_strategy?

    "auto": analiza automáticamente según el contenido. "text_only": analiza solo texto. "text_and_images": analiza tanto imágenes como texto (aumenta el tiempo de análisis).

  3. ¿Cómo puedo determinar si un archivo ha terminado de analizarse?

    Intente iniciar una conversación con el ID del archivo. Si el archivo aún se está analizando, la API devuelve File parsing in progress, please try again later.; reinténtelo después de un breve retraso. Si la llamada se realiza correctamente, el archivo está listo.

  4. ¿El proceso de análisis después de la carga del archivo genera costos adicionales?

    El análisis de documentos es gratuito.

Referencia de API

Para los parámetros de entrada y salida de Qwen-Doc-Turbo, consulte la Referencia de API compatible con OpenAI o la Referencia de API de DashScope.

Códigos de error

Si la llamada al modelo falla y devuelve un mensaje de error, consulte Códigos de error para su resolución.

Limitaciones

  • Dependencias del SDK:
    • URL de archivo (doc_url): Solo admite el protocolo DashScope. Utilice el DashScope Python SDK o llamadas HTTP (como curl).
    • Cargar archivo (file-id): Debe utilizar un SDK compatible con OpenAI para la carga y gestión.
  • Carga y referencia de archivos:
    • URL de archivo (doc_url): Hasta 10 URLs por solicitud. Las URLs deben ser de acceso público.

    • Cargar archivo (file-id): Máximo 150 MB por archivo. Límites de la cuenta: 10,000 archivos o 100 GB en total (los archivos nunca caducan). Cada solicitud hace referencia a un solo archivo.

      Las solicitudes de carga fallan cuando se alcanzan los límites. Elimine los archivos innecesarios para liberar cuota. Consulte Compatible con OpenAI - Archivo para más detalles.

    • Formatos admitidos: TXT, DOC, DOCX, PDF, XLS, XLSX, MD, PPT, PPTX, JPG, JPEG, PNG, GIF y BMP.

  • Entrada de API:
    • Usando doc_url o file-id: máx. 262,144 tokens.
    • Texto sin formato en mensajes user/system: máx. 9,000 tokens por mensaje.
  • Salida de API:
    • La longitud máxima de salida es de 32,768 tokens.
  • Uso compartido de archivos:
    • file-id funciona solo dentro de la cuenta generadora, no entre cuentas ni con claves de API de usuarios RAM.
  • Límite de tasa: Consulte Limitación de tasa.