获取预置模型版本详情
更新时间:2025-09-23
功能介绍
用于获取预置模型版本详情。
使用说明
本文API支持通过Python SDK、Go SDK、Java SDK 和 Node.js SDK调用,调用流程请参考SDK安装及使用流程。
SDK调用
调用示例
1import os
2from qianfan  import resources
3
4# 通过环境变量初始化认证信息
5# 使用安全认证AK/SK调用,替换下列示例中参数,安全认证Access Key替换your_iam_ak,Secret Key替换your_iam_sk,如何获取请查看https://cloud.baidu.com/doc/Reference/s/9jwvz2egb
6os.environ["QIANFAN_ACCESS_KEY"] = "your_iam_ak"
7os.environ["QIANFAN_SECRET_KEY"] = "your_iam_sk"
8
9resp = resources.console.utils.call_action(
10    # 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求结构-请求地址的后缀
11    "/v2/model", 
12    # 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求参数-Query参数的Action 
13    "DescribeSystemModel", 
14    # 请查看本文请求参数说明,根据实际使用选择参数;对应API调用文档-请求参数-Body参数
15    {
16        "modelId":"amv-jkxxxxx75x5j"
17    }
18)
19print(resp.body)
        1package main
2
3import (
4    "context"
5    "fmt"
6    "os"
7
8    "github.com/baidubce/bce-qianfan-sdk/go/qianfan"
9)
10
11func main() {
12     // 使用安全认证AK/SK鉴权,通过环境变量初始化;替换下列示例中参数,安全认证Access Key替换your_iam_ak,Secret Key替换your_iam_sk
13    os.Setenv("QIANFAN_ACCESS_KEY", "your_iam_ak")
14    os.Setenv("QIANFAN_SECRET_KEY", "your_iam_sk")
15    
16    ca := qianfan.NewConsoleAction()
17    
18    res, err := ca.Call(context.TODO(), 
19     // 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求结构-请求地址的后缀
20    "/v2/model",
21    // 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求参数-Query参数的Action 
22     "DescribeSystemModel",
23     // 请查看本文请求参数说明,根据实际使用选择参数;对应API调用文档-请求参数-Body参数
24      map[string]interface{}{
25        "modelId":"amv-jkxxxxx75x5j",
26    })
27    if err != nil {
28        panic(err)
29    }
30    fmt.Println(string(res.Body))
31    
32}
        1import com.baidubce.qianfan.Qianfan;
2import com.baidubce.qianfan.model.console.ConsoleResponse;
3import com.baidubce.qianfan.util.CollUtils;
4import com.baidubce.qianfan.util.Json;
5import java.util.Map;
6
7public class Dome {
8    public static void main(String args[]){
9        // 使用安全认证AK/SK鉴权,替换下列示例中参数,安全认证Access Key替换your_iam_ak,Secret Key替换your_iam_sk
10        Qianfan qianfan = new Qianfan("your_iam_ak", "your_iam_sk");
11        
12        ConsoleResponse<Map<String, Object>> response = qianfan.console()
13                // 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求结构-请求地址的后缀
14                .route("/v2/model")
15                // 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求参数-Query参数的Action 
16                .action("DescribeSystemModel")
17                // 需要传入参数的场景,可以自行封装请求类,或者使用Map.of()来构建请求Body
18                // Java 8可以使用SDK提供的CollUtils.mapOf()来替代Map.of()
19                // 请查看本文请求参数说明,根据实际使用选择参数;对应API调用文档-请求参数-Body参数
20                .body(CollUtils.mapOf(
21                    "modelId","amv-jkxxxxx75x5j"
22                ))
23                .execute();
24
25        System.out.println(Json.serialize(response));
26    }
27}
        1import {consoleAction, setEnvVariable} from "@baiducloud/qianfan";
2
3// 使用安全认证AK/SK鉴权,通过环境变量初始化;替换下列示例中参数,安全认证Access Key替换your_iam_ak,Secret Key替换your_iam_sk
4setEnvVariable('QIANFAN_ACCESS_KEY','your_iam_ak');
5setEnvVariable('QIANFAN_SECRET_KEY','your_iam_sk');
6
7async function main() {
8  //base_api_route:调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求结构-请求地址的后缀
9  //action:调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求参数-Query参数的Action 
10  //data:请查看本文请求参数说明,根据实际使用选择参数;对应API调用文档-请求参数-Body参数
11  const res = await consoleAction({base_api_route: '/v2/model', action: 'DescribeSystemModel', data: {
12        "modelId":"amv-jkxxxxx75x5j"
13  });    
14    
15  console.log(res);
16}
17
18main();
        返回示例
1{
2    "requestId": "89567489-xxxx-4e4a-a552-6d8e37948683",
3    "result": {
4        "modelSetId": "am-anxxxxxiy92d",
5        "modelId": "amv-jkxxxxx75x5j",
6        "modelName": "ERNIE-X1-Turbo-32K",
7        "status": "Ready",
8        "modelApplicationType": "chat",
9        "tokenLimitations": {
10            "trivial": {
11                "inputTokens": 23552,
12                "outputTokens": 28160,
13                "characterLimit": 0
14            }
15        },
16        "createTime": "2025-04-24T23:27:08+08:00",
17        "modifyTime": "2025-09-04T18:03:29+08:00",
18        "isSupportDeploy": False,
19        "isSupportModelComp": False,
20        "isSupportEvaluation": False,
21        "resourceType": None,
22        "capabilities": [
23            "reasoning",
24            "function_call"
25        ],
26        "modelProviders": [
27            "百度"
28        ]
29    }
30}
        1{
2    "requestId": "89567489-xxxx-4e4a-a552-6d8e37948683",
3    "result": {
4        "modelSetId": "am-anxxxxxiy92d",
5        "modelId": "amv-jkxxxxx75x5j",
6        "modelName": "ERNIE-X1-Turbo-32K",
7        "status": "Ready",
8        "modelApplicationType": "chat",
9        "tokenLimitations": {
10            "trivial": {
11                "inputTokens": 23552,
12                "outputTokens": 28160,
13                "characterLimit": 0
14            }
15        },
16        "createTime": "2025-04-24T23:27:08+08:00",
17        "modifyTime": "2025-09-04T18:03:29+08:00",
18        "isSupportDeploy": false,
19        "isSupportModelComp": false,
20        "isSupportEvaluation": false,
21        "resourceType": null,
22        "capabilities": [
23            "reasoning",
24            "function_call"
25        ],
26        "modelProviders": [
27            "百度"
28        ]
29    }
30}
        1{
2    "requestId": "89567489-xxxx-4e4a-a552-6d8e37948683",
3    "result": {
4        "modelSetId": "am-anxxxxxiy92d",
5        "modelId": "amv-jkxxxxx75x5j",
6        "modelName": "ERNIE-X1-Turbo-32K",
7        "status": "Ready",
8        "modelApplicationType": "chat",
9        "tokenLimitations": {
10            "trivial": {
11                "inputTokens": 23552,
12                "outputTokens": 28160,
13                "characterLimit": 0
14            }
15        },
16        "createTime": "2025-04-24T23:27:08+08:00",
17        "modifyTime": "2025-09-04T18:03:29+08:00",
18        "isSupportDeploy": false,
19        "isSupportModelComp": false,
20        "isSupportEvaluation": false,
21        "resourceType": null,
22        "capabilities": [
23            "reasoning",
24            "function_call"
25        ],
26        "modelProviders": [
27            "百度"
28        ]
29    }
30}
        1{
2    "requestId": "89567489-xxxx-4e4a-a552-6d8e37948683",
3    "result": {
4        "modelSetId": "am-anxxxxxiy92d",
5        "modelId": "amv-jkxxxxx75x5j",
6        "modelName": "ERNIE-X1-Turbo-32K",
7        "status": "Ready",
8        "modelApplicationType": "chat",
9        "tokenLimitations": {
10            "trivial": {
11                "inputTokens": 23552,
12                "outputTokens": 28160,
13                "characterLimit": 0
14            }
15        },
16        "createTime": "2025-04-24T23:27:08+08:00",
17        "modifyTime": "2025-09-04T18:03:29+08:00",
18        "isSupportDeploy": false,
19        "isSupportModelComp": false,
20        "isSupportEvaluation": false,
21        "resourceType": null,
22        "capabilities": [
23            "reasoning",
24            "function_call"
25        ],
26        "modelProviders": [
27            "百度"
28        ]
29    }
30}
        请求参数
| 名称 | 类型 | 必填 | 描述 | 
|---|---|---|---|
| modelId | string | 是 | 模型版本id,通过调用获取预置模型列表接口,返回的modelIds字段获取该字段值 | 
返回参数
| 名称 | 类型 | 描述 | 
|---|---|---|
| requestId | string | 请求ID | 
| result | object | 请求结果 | 
result说明
| 名称 | 类型 | 描述 | 
|---|---|---|
| modelSetId | string | 模型id | 
| modelId | string | 模型版本id | 
| modelName | string | 模型版本名称 | 
| status | string | 状态,说明:  · Ready:已就绪 · Creating:创建中 · Fail:创建失败  | 
| description | string | 模型版本描述 | 
| createTime | string | 模型版本创建时间 | 
| modifyTime | string | 模型版本修改时间 | 
| modelApplicationType | string | 输入输出模式,说明:  · chat:对话模式 · completion:续写模式 · embedding:向量模式 · reranker:重排序模式 · Text-to-Image:文生图模式 · Image-to-Text:图生文模式 · video:视频生成模式 · voice:语音生成  | 
| tokenLimitations | object | 输入输出长度限制 | 
| isSupportDeploy | bool | 是否支持部署 | 
| isSupportModelComp | bool | 是否支持压缩 | 
| isSupportEvaluation | bool | 是否支持评估 | 
| capabilities | []string | 模型支持的能力: · reasoning:支持推理思考能力 · function_call:支持工具调用能力 · web_search:支持联网检索增强  | 
| modelProviders | []string | 模型提供商,返回参考MB模型广场首页筛选项 | 
tokenLimitations说明
| 名称 | 类型 | 描述 | 
|---|---|---|
| trivial | object | modelApplicationType非reranker类型的模型上下文限制 | 
| reranker | object | modelApplicationType为reranker类型的模型上下文限制 | 
trivial说明
| 名称 | 类型 | 描述 | 
|---|---|---|
| inputTokens | int | 输入tokens限制 | 
| outputTokens | int | 输出tokens限制 | 
| characterLimit | int | 字符数限制 | 
reranker说明
| 名称 | 类型 | 描述 | 
|---|---|---|
| queryTokens | int | query的tokens限制 | 
| queryCharacterLimit | int | query的字符数限制 | 
| documentTokens | int | document的tokens限制 | 
| documentCharacterLimit | int | document的字符数限制 | 
