Tous les produits
Search
Centre de documentation

Alibaba Cloud Model Studio:Data mining (Qwen-Doc-Turbo)

Dernière mise à jour :Oct 11, 2026

Le modèle d'exploration de données extrait des informations, modère le contenu, classe les données et génère des résumés. Il produit des données structurées (comme du JSON) rapidement et avec précision, contrairement aux modèles de chat polyvalents qui peuvent renvoyer des formats incohérents ou extraire les informations de manière incorrecte. De plus, ce modèle prend en charge la génération de présentations PPT à partir du contenu de documents, avec un mode basé sur des modèles et un mode créatif disponibles.

De plus, ce modèle prend en charge la génération de présentations PPT à partir du contenu de documents, avec un mode basé sur des modèles et un mode créatif disponibles.

RemarqueCette documentation s'applique uniquement à la région Chine (Pékin). Pour utiliser le modèle, vous devez utiliser une clé API de la région Chine (Pékin).

Guide de mise en œuvre

Qwen-Doc-Turbo permet d'extraire des informations à partir de fichiers selon trois méthodes. Pour plus d'informations sur les limites de taille et de type de fichier, consultez la section Limites.

Fonctionnalité

URL de fichier (recommandé)

ID de fichier

Texte brut

Source du fichier

URL publique

Fichier local (téléchargement requis)

Transmis sous forme de chaîne

Limite de longueur d'entrée

Jusqu'à 10 fichiersPrend en charge les fichiers volumineux (entrée maximale de 253 k tokens)

1 fichierPrend en charge les fichiers volumineux (entrée maximale de 253 k tokens)

Jusqu'à 9 000 tokens

Compatibilité SDK

Uniquement DashScope

Téléchargement : OpenAI Appel : OpenAI et DashScope

OpenAI et DashScope

Principaux avantages

Aucun téléchargement vers Model Studio requis. Prend en charge les appels par lots.

Évite les téléchargements répétés. Idéal pour la réutilisation.

Aucune gestion de fichier requise.

Prérequis

Transmettre une URL de fichier

Extrayez des données structurées à l'aide d'URL de fichier (jusqu'à 10 fichiers simultanément). Cet exemple transmet les fichiers Manuel de produit A – Exemple et Manuel de produit B – Exemple et invite le modèle à renvoyer les informations extraites au format JSON.

La méthode par URL de fichier prend uniquement en charge le protocole DashScope. Utilisez le SDK Python DashScope ou des appels HTTP (comme 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/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"
                        }
                    ]
                }
            ]
    }
}'

RemarqueLe modèle renvoie les données extraites sous forme de tableau JSON dans le champ content. Notez que le contenu peut être encapsulé dans des marqueurs de bloc de code Markdown (par exemple, json\n[...]\n). Vous devez supprimer ces marqueurs Markdown avant d'analyser la réponse avec 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)

Exemple de réponse

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

Transmettre un ID de fichier

Télécharger un fichier

Avant d'exécuter le code, téléchargez le fichier Manuel de produit A – Exemple et placez-le dans le répertoire de votre projet. Téléchargez le fichier via l'interface compatible OpenAI pour obtenir un file-id. Pour plus de détails sur l'API de téléchargement, consultez la section Référence de l'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"'

Exécutez le code pour obtenir l'file-id du fichier téléchargé.

Transmettre des informations et lancer une conversation à l'aide d'un ID de fichier

Transmettez le file-id dans un message système (après le message de définition du rôle). Le message utilisateur contient votre requête concernant le fichier.

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/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) {
        // 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
    }
}'

Exemple complet : téléversement d'un fichier et appel du modèle

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/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) {
        // 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();
        }
    }
}

RemarqueLe modèle renvoie les données extraites sous forme de tableau JSON dans le champ content. Notez que le contenu peut être encapsulé dans des marqueurs de bloc de code Markdown (par exemple, json\n[...]\n). Vous devez supprimer ces marqueurs Markdown avant d'analyser la réponse avec 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)

Exemple de réponse

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

Transmettre du texte brut

Vous pouvez transmettre le contenu du fichier directement sous forme de chaîne au lieu d'utiliser un file-id. Pour éviter toute confusion, placez le message de définition du rôle en premier dans le tableau messages.

Si le contenu textuel dépasse 9 000 jetons, utilisez plutôt une URL de fichier ou un ID de fichier (en raison des limites de taille du corps de l'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/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) {
        // 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
    }
}'

RemarqueLe modèle renvoie les données extraites sous forme de tableau JSON dans le champ content. Notez que le contenu peut être encapsulé dans des marqueurs de bloc de code Markdown (par exemple, json\n[...]\n). Vous devez supprimer ces marqueurs Markdown avant d'analyser la réponse avec 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)

Exemple de réponse

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

Tarification du modèle

Modèle

Fenêtre de contexte

Entrée maximale

Sortie maximale

Coût d'entrée

Coût de sortie

Quota gratuit

(Jetons)

(Million de jetons)

qwen-doc-turbo

262 144

253 952

32 768

0,087 USD

0,144 USD

Aucun quota gratuit

FAQ

  1. Où les fichiers sont-ils stockés après avoir été téléchargés via l'interface de fichier compatible OpenAI ?

    Les fichiers téléchargés via l'interface compatible OpenAI sont stockés gratuitement dans votre bucket Model Studio. Pour interroger et gérer les fichiers, reportez-vous à Interface de fichier OpenAI.

  2. Lors du téléchargement à l'aide de la méthode URL de fichier, quelles sont les différences entre les options du paramètre file_parsing_strategy ?

    « auto » : analyse automatiquement en fonction du contenu. « text_only » : analyse uniquement le texte. « text_and_images » : analyse à la fois les images et le texte (augmente le temps d'analyse).

  3. Comment puis-je déterminer si l'analyse d'un fichier est terminée ?

    Essayez de démarrer une conversation avec l'ID de fichier. Si le fichier est toujours en cours d'analyse, l'API renvoie File parsing in progress, please try again later. — réessayez après un délai. Si l'appel réussit, le fichier est prêt.

  4. Le processus d'analyse après le téléchargement du fichier entraîne-t-il des coûts supplémentaires ?

    L'analyse des documents est gratuite.

Référence API

Pour les paramètres d'entrée et de sortie de Qwen-Doc-Turbo, reportez-vous à Référence API compatible OpenAI ou Référence API DashScope.

Codes d'erreur

Si l'appel au modèle échoue et renvoie un message d'erreur, reportez-vous aux Codes d'erreur pour résoudre le problème.

Limites

  • Dépendances SDK :
    • URL de fichier (doc_url) : Prend en charge uniquement le protocole DashScope. Utilisez le SDK Python DashScope ou les appels HTTP (comme curl).
    • Téléchargement de fichier (file-id) : Doit utiliser un SDK compatible OpenAI pour le téléchargement et la gestion.
  • Téléchargement et référence de fichier :
    • URL de fichier (doc_url) : Jusqu'à 10 URL par requête. Les URL doivent être accessibles publiquement.

    • Téléchargement de fichier (file-id) : Maximum 150 Mo par fichier. Limites du compte : 10 000 fichiers ou 100 Go au total (les fichiers n'expirent jamais). Chaque requête référence un seul fichier.

      Les requêtes de téléchargement échouent lorsque les limites sont atteintes. Supprimez les fichiers inutiles pour libérer du quota. Consultez Compatible OpenAI - Fichier pour plus de détails.

    • Formats pris en charge : TXT, DOC, DOCX, PDF, XLS, XLSX, MD, PPT, PPTX, JPG, JPEG, PNG, GIF et BMP.

  • Entrée API :
    • Utilisation de doc_url ou file-id : maximum 262 144 jetons.
    • Texte brut dans les messages user/system : maximum 9 000 jetons par message.
  • Sortie API :
    • La longueur de sortie maximale est de 32 768 jetons.
  • Partage de fichier :
    • file-id fonctionne uniquement au sein du compte générateur — pas entre comptes ni avec les clés API des utilisateurs RAM.
  • Limite de débit : Reportez-vous à Limitation de débit.