百宝箱开放平台 ✖️ 获取模型返回

简介: 通过模型效果盲测接口,开发者可一次性调用多种模型生成内容,用于对比用户对不同智能体的偏好。支持流式输出与多轮对话,并可通过反馈接口提交数据,助力优选适配业务场景的底层模型。

通过调用模型效果盲测接口,开发者可以实现一次调用过程中,使用多种不同的模型进行内容生成。适用于在实际业务场景下,做用户对不同模型底座的智能体的喜好对比。

说明:

通过本接口进行模型效果测评后,您可以使用效果反馈接口,将测评数据反馈给百宝箱,百宝箱会将收集到的反馈数据进行计分排行,用于展示在不同业务场景下,最适配的底层模型。

前提条件

在调用本接口前,请先完成应用的发布,若无,请参见:发布应用,完成相关事项。

请求地址

百宝箱支持开发者在以下两个请求地址中选择任意一个地址发起请求。

请求头

参数名

是否必填

类型

说明

示例

Authorization

String

用于验证客户端身份的访问令牌,你可以在百宝箱中获取,获取方式可参见:授权管理

pat_2j4e******THUIVRH1

AppCode

String

应用接入点 code。获取路径:访问模型效果盲测 > 新建应用接入点 > appCode。

202506e******00450562

请求参数

下文将按照请求地址的不同分别介绍请求参数。

model/responses

参数名

是否必填

类型

说明

示例

model

String

需要测试的模型。支持:

  • auto:随机模型;
  • "模型名称":指定模型,多个模型时,请用英文逗号分割。

auto

input

String

替换为您想要提问的问题。如果是多轮对话,需要符合 OpenAI messages 协议。

今天的国际金价是多少

user

String

用户 ID。

-

tools

Array

模型效果盲测中内置的全网搜索工具。

[{"type": "web_search_preview"}]

extra_body

Object

目前只接收一个参数n,本次需要使用几个模型进行生成,仅当model=auto 时生效。

"n": 3

请求示例

curl --location 'https://api.tbox.cn/api/model/responses' \
--header 'Authorization: Bearer {your_token}' \
--header 'AppCode: {app_code}' \
--header 'Content-Type: application/json' \
--header 'Accept: text/event-stream' \
--header 'Cookie: receive-cookie-deprecation=1' \
--data '{
    "model": "auto",
    "input": "今天的国际金价是多少?",
    "user": "{user_id}",
    "tools": [
        {
            "type": "web_search_preview"
        }
    ],
    "stream": true,
    "extra_body": {
      "n": 3
    }
}'

model/completions

参数名

是否必填

类型

说明

示例

model

String

需要测试的模型。支持:

  • auto:随机模型;
  • "模型名称":指定模型,多个模型时,请用英文逗号分割。

auto

messages

Object

替换为您想要提问的问题。如果是多轮对话,需要符合 OpenAI messages 协议。

[{"role": "system", "content": "你是一个专业翻译,保持原文风格"},{"role": "user", "content": "The pursuit of knowledge is a lifelong journey"}]

n

String

本次测评涉及的模型数量。

  • 仅 model=auto 时生效。
  • 数量限制: 1 ≤ n ≤ 5。

3

stream

Boolean

是否使用流式输出响应内容。

false

请求示例

curl --location 'https://api.tbox.cn/api/model/chat/completions' \
--header 'Authorization: Bearer {your_token}' \
--header 'AppCode: {app_code}' \
--header 'Content-Type: application/json' \
--data '{
    "model": "auto",
    "messages": [
        {"role": "system", "content": "你是一个专业翻译,保持原文风格"},
        {"role": "user", "content": "The pursuit of knowledge is a lifelong journey"}
    ],
    "n": 2,
    "stream": false
}'

返回参数

model/responses

参数

类型

说明

示例

event

String

事件类型

response.output_text.delta

data.type

String

事件详细类型

response.output_text.delta

data.response.id

String

响应唯一 ID

resp_7b151ed6e2fc4cb899ff433886b81664

data.response.status

String

当前状态

in_progress / completed

data.response.model

String

使用的模型名称

qwen-max-latest

data.item_id

String

输出项 ID

7c83dc6375b443cbb3b1e27c0dd3ff75

data.output_index

Integer

输出项索引位置

0

data.content_index

Integer

内容段索引位置

0

data.delta

String

增量文本内容(Unicode 编码)

\u4eca\u5929

data.tool_id

String

工具调用唯一 ID

call_IyGKdnpKpJ6m1maVLA9kdksE

返回示例

event: response.created
data: {"type": "response.created", "response": {"id": "resp_7b151ed6e2fc4cb899ff433886b81664", "object": "response", "created_at": 1749721513, "status": "in_progress", "error": null, "incomplete_details": null, "instructions": null, "max_output_tokens": 512, "model": "qwen-max-latest", "output": [], "parallel_tool_calls": false, "previous_response_id": "", "reasoning": {"effort": 0, "summary": null}, "store": true, "temperature": 0.7, "text": {"format": {"type": "text"}}, "tool_choice": "auto", "tools": [{"type": "web_search_preview"}], "top_p": 0.9, "truncation": "disabled", "usage": null, "user": "ezK16lM", "metadata": {}}}
event: response.in_progress
data: {"type": "response.in_progress", "response": {"id": "resp_7b151ed6e2fc4cb899ff433886b81664", "object": "response", "created_at": 1749721513, "status": "in_progress", "error": null, "incomplete_details": null, "instructions": null, "max_output_tokens": 512, "model": "qwen-max-latest", "output": [], "parallel_tool_calls": false, "previous_response_id": "", "reasoning": {"effort": 0, "summary": null}, "store": true, "temperature": 0.7, "text": {"format": {"type": "text"}}, "tool_choice": "auto", "tools": [{"type": "web_search_preview"}], "top_p": 0.9, "truncation": "disabled", "usage": null, "user": "ezK16lM", "metadata": {}}}
event: response.output_item.added
data: {"type": "response.output_item.added", "item": {"id": "7c83dc6375b443cbb3b1e27c0dd3ff75", "status": "in_progress", "type": "message", "role": "assistant", "content": []}, "output_index": 0}
event: response.web_search_call.in_progress
data: {"type": "response.web_search_call.in_progress", "output_index": 0, "model": "qwen-max-latest", "item_id": "7c83dc6375b443cbb3b1e27c0dd3ff75", "tool_id": "call_IyGKdnpKpJ6m1maVLA9kdksE", "tool_input": ""}
...
event: response.output_text.delta
data: {"type": "response.output_text.delta", "model": "qwen-max-latest", "item_id": "7c83dc6375b443cbb3b1e27c0dd3ff75", "output_index": 18, "content_index": 0, "delta": "\u4eca\u5929"}
event: response.output_text.delta
data: {"type": "response.output_text.delta", "model": "qwen-max-latest", "item_id": "7c83dc6375b443cbb3b1e27c0dd3ff75", "output_index": 19, "content_index": 0, "delta": "\u7684"}
...
event: response.output_item.done
data: {"type": "response.output_item.done", "output_index": 98, "item": {"id": "7c83dc6375b443cbb3b1e27c0dd3ff75", "type": "message", "status": "completed", "role": "assistant", "content": [{"type": "output_text", "text": "\u6211\u53ef\u4ee5\u5e2e\u60a8\u67e5\u8be2\u4eca\u5929\u7684\u56fd\u9645\u91d1\u4ef7\u3002\u8ba9\u6211\u901a\u8fc7\u641c\u7d22\u83b7\u53d6\u6700\u65b0\u4fe1\u606f\u3002\u6839\u636e\u6700\u65b0\u641c\u7d22\u7ed3\u679c\uff0c\u4eca\u5929\u7684\u56fd\u9645\u91d1\u4ef7\u4fe1\u606f\u5982\u4e0b\uff1a\n\n**\u6700\u65b0\u56fd\u9645\u91d1\u4ef7\uff082025\u5e743\u670826\u65e5\uff09\uff1a**\n- \u56fd\u9645\u9ec4\u91d1\u4ef7\u683c\uff1a3017.77 \u7f8e\u5143/\u76ce\u53f8\n\n\u6b64\u5916\uff0c\u6839\u636e\u5176\u4ed6\u641c\u7d22\u7ed3\u679c\u663e\u793a\u7684\u6700\u8fd1\u6570\u636e\uff1a\n- \u4f26\u6566\u73b0\u8d27\u9ec4\u91d1\u4ef7\u683c\uff1a2936.57 \u7f8e\u5143/\u76ce\u53f8\uff08\u6da8\u5e45+0.049%\uff09\n- \u7ebd\u7ea6\u671f\u8d27\u56fd\u9645\u91d1\u4ef7\uff1a2953.24 \u7f8e\u5143/\u76ce\u53f8\uff08\u6da8\u5e45+0.144%\uff09\n- \u4e2d\u56fd\u9ec4\u91d1\u4ef7\u683c\uff08\u4e0a\u6d77\u9ec4\u91d1\u4ea4\u6613\u6240\uff09\uff1a683.73 \u4eba\u6c11\u5e01/\u514b\uff08\u8dcc\u5e45-0.401%\uff09\n\n\u8bf7\u6ce8\u610f\uff0c\u91d1\u4ef7\u4f1a\u968f\u5e02\u573a\u6ce2\u52a8\u800c\u53d8\u5316\uff0c\u4ee5\u4e0a\u6570\u636e\u4ec5\u4f9b\u53c2\u8003\uff0c\u5b9e\u9645\u4ea4\u6613\u8bf7\u4ee5\u5b98\u65b9\u62a5\u4ef7\u4e3a\u51c6\u3002", "annotations": []}], "model": "qwen-max-latest"}}
event: response.completed
data: {"id": "resp_7b151ed6e2fc4cb899ff433886b81664", "object": "response", "created_at": 1749721513, "status": "completed", "error": null, "incomplete_details": null, "instructions": null, "max_output_tokens": 512, "model": "qwen-max-latest", "output": [{"id": "7c83dc6375b443cbb3b1e27c0dd3ff75", "type": "message", "status": "completed", "role": "assistant", "content": [{"type": "output_text", "text": "\u4eca\u5929\u7684\u56fd\u9645\u91d1\u4ef7\u4e3a2861.81\u7f8e\u5143/\u76ce\u53f8\uff0c\u6298\u5408\u4eba\u6c11\u5e01\u4e3a670.70\u5143/\u514b\u3002\u8bf7\u6ce8\u610f\uff0c\u5177\u4f53\u4ef7\u683c\u53ef\u80fd\u4f1a\u56e0\u5e02\u573a\u6ce2\u52a8\u800c\u6709\u6240\u53d8\u5316\u3002", "annotations": []}], "model": "qwen-max-latest"}, {"id": "7c83dc6375b443cbb3b1e27c0dd3ff75", "type": "message", "status": "completed", "role": "assistant", "content": [{"type": "output_text", "text": "\u6211\u53ef\u4ee5\u5e2e\u60a8\u67e5\u8be2\u4eca\u5929\u7684\u56fd\u9645\u91d1\u4ef7\u3002\u8ba9\u6211\u901a\u8fc7\u641c\u7d22\u83b7\u53d6\u6700\u65b0\u4fe1\u606f\u3002\u6839\u636e\u6700\u65b0\u641c\u7d22\u7ed3\u679c\uff0c\u4eca\u5929\u7684\u56fd\u9645\u91d1\u4ef7\u4fe1\u606f\u5982\u4e0b\uff1a\n\n**\u6700\u65b0\u56fd\u9645\u91d1\u4ef7\uff082025\u5e743\u670826\u65e5\uff09\uff1a**\n- \u56fd\u9645\u9ec4\u91d1\u4ef7\u683c\uff1a3017.77 \u7f8e\u5143/\u76ce\u53f8\n\n\u6b64\u5916\uff0c\u6839\u636e\u5176\u4ed6\u641c\u7d22\u7ed3\u679c\u663e\u793a\u7684\u6700\u8fd1\u6570\u636e\uff1a\n- \u4f26\u6566\u73b0\u8d27\u9ec4\u91d1\u4ef7\u683c\uff1a2936.57 \u7f8e\u5143/\u76ce\u53f8\uff08\u6da8\u5e45+0.049%\uff09\n- \u7ebd\u7ea6\u671f\u8d27\u56fd\u9645\u91d1\u4ef7\uff1a2953.24 \u7f8e\u5143/\u76ce\u53f8\uff08\u6da8\u5e45+0.144%\uff09\n- \u4e2d\u56fd\u9ec4\u91d1\u4ef7\u683c\uff08\u4e0a\u6d77\u9ec4\u91d1\u4ea4\u6613\u6240\uff09\uff1a683.73 \u4eba\u6c11\u5e01/\u514b\uff08\u8dcc\u5e45-0.401%\uff09\n\n\u8bf7\u6ce8\u610f\uff0c\u91d1\u4ef7\u4f1a\u968f\u5e02\u573a\u6ce2\u52a8\u800c\u53d8\u5316\uff0c\u4ee5\u4e0a\u6570\u636e\u4ec5\u4f9b\u53c2\u8003\uff0c\u5b9e\u9645\u4ea4\u6613\u8bf7\u4ee5\u5b98\u65b9\u62a5\u4ef7\u4e3a\u51c6\u3002", "annotations": []}], "model": "anthropic/claude-3.7-sonnet"}], "parallel_tool_calls": false, "previous_response_id": "", "reasoning": {"effort": 0, "summary": null}, "store": true, "temperature": 0.7, "text": {"format": {"type": "text"}}, "tool_choice": "auto", "tools": [{"type": "web_search_preview"}], "top_p": 0.9, "truncation": "disabled", "usage": null, "user": "ezK16lM", "metadata": {}, "type": "response.completed"}
event: response.completed
data: [DONE]

model/completions

参数

类型

说明

id

String

本次请求的唯一标识

object

String

固定值 "chat.completion"

created

Integer

响应生成的时间戳(Unix 时间戳,单位:秒)

models

Array[Str]

使用的模型列表

choices

Array[Choice]

包含模型生成的文本结果数组,数组长度通常和 n 值相同;

usage

Usage

Token 消耗统计信息

choice

参数

类型

说明

finish_reason

String

生成结束原因(示例:"stop" 表示正常终止)

index

Integer

结果在 choices数组中的索引(从 0 开始)

logprobs

null

保留字段

message

ChoiceMessage

模型生成的消息内容

content_filter_results

Object

内容安全过滤结果

message_id

String

消息的唯一标识

model

String

生成此结果的模型名称

ChoiceMessage

字段名

类型

说明

content

String

核心输出,模型生成的文本内容;

refusal

null

拒绝回答时的说明(null 表示未触发拒绝)

role

String

消息角色(固定为 "assistant",表示模型回复)

audio

null

音频输出(null 表示无音频)

function_call

null

函数调用请求(null 表示未调用函数)

tool_calls

null

工具调用请求(null 表示未调用工具)

Usage

字段名

类型

说明

prompt_tokens

Integer

输入提示消耗的 Token 数量

completion_tokens

Integer

输出结果消耗的 Token 数量

total_tokens

Integer

总 Token 消耗量

返回示例

{
    "id": "9f10f75262614014b495357c15c8a694",
    "object": "chat.completion",
    "created": 1750411923,
    "models": [
        "meta-llama/llama-4-scout-17b-16e-instruct",
        "deepseek/deepseek-r1-distill-qwen-14b"
    ],
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "logprobs": null,
            "message": {
                "content": "求知是终身的旅程",
                "refusal": null,
                "role": "assistant",
                "audio": null,
                "function_call": null,
                "tool_calls": null
            },
            "content_filter_results": {
                "hate": {
                    "filtered": false
                },
                "self_harm": {
                    "filtered": false
                },
                "sexual": {
                    "filtered": false
                },
                "violence": {
                    "filtered": false
                },
                "jailbreak": {
                    "filtered": false,
                    "detected": false
                },
                "profanity": {
                    "filtered": false,
                    "detected": false
                }
            },
            "message_id": "bae9679e151c40e980605257e9eb162e",
            "model": "meta-llama/llama-4-scout-17b-16e-instruct"
        },
        {
            "finish_reason": "stop",
            "index": 1,
            "logprobs": null,
            "message": {
                "content": "<think>\nAlright, so I need to translate the sentence \"The pursuit of knowledge is a lifelong journey\" into Chinese. Let me think about how to approach this.\n\nFirst, the main idea is \"the pursuit of knowledge.\" In Chinese, that would probably be \"知识的追求.\" But wait, sometimes people use \"知识追求\" without the 的, but maybe adding 的 makes it smoother. I think \"知识的追求\" sounds better here.\n\nNext, the verb \"is\" translates to \"是.\" Then \"a lifelong journey.\" \"Lifelong\" can be translated as \"一生的\" or \"毕生的.\" I think \"毕生的\" might sound a bit more elegant, like \"毕生的旅程.\" Alternatively, \"一生的旅程\" is also correct, but \"毕生的旅程\" feels more poetic, which suits the original sentence's tone.\n\nPutting it all together: \"知识的追求是一生的旅程\" or \"知识的追求是毕生的旅程.\" I think between these two, \"毕生的旅程\" adds a touch of formality and depth, matching the idea of a lifelong pursuit.\n\nAnother option is \"知识的追求是一生的旅程,\" which is straightforward and clear. It depends on the context whether to go for elegance or simplicity. Since the original sentence has a philosophical tone, maybe leaning towards the more elegant version is better.\n\nWait, I can also consider the flow. \"知识的追求\" as a noun phrase feels a bit heavy, so maybe \"追求知识\" could work too, but then it changes the structure. But the original sentence starts with \"The pursuit of knowledge,\" which is a noun phrase, so to keep that structure, \"知识的追求\" is better.\n\nSo, finalizing, \"知识的追求是一生的旅程\" or \"知识的追求是毕生的旅程.\" Either is fine, but I think the second one has a nicer ring to it.\n</think>\n\n知识的追求是毕生的旅程。",
                "refusal": null,
                "role": "assistant",
                "audio": null,
                "function_call": null,
                "tool_calls": null
            },
            "content_filter_results": {
                "hate": {
                    "filtered": false
                },
                "self_harm": {
                    "filtered": false
                },
                "sexual": {
                    "filtered": false
                },
                "violence": {
                    "filtered": false
                },
                "jailbreak": {
                    "filtered": false,
                    "detected": false
                },
                "profanity": {
                    "filtered": false,
                    "detected": false
                }
            },
            "message_id": "348903ddedf943b7a12185843243c1d6",
            "model": "deepseek/deepseek-r1-distill-qwen-14b"
        }
    ],
    "usage": {
        "prompt_tokens": 49,
        "completion_tokens": 417,
        "total_tokens": 466
    }
}

后续可选操作

通过本文档所述接口进行模型效果测评后,您可以使用效果反馈接口,将测评数据反馈给百宝箱,百宝箱将收集到的反馈数据进行计分排行,用于展示在不同业务场景下,最适配的底层模型。接口说明请参见:盲测结果反馈

常见问题

使用模型效果盲测(含结果)能力时,开发者可能遇见的问题以及对应的解法可参见:常见问题

相关文章
|
5月前
|
自然语言处理 JavaScript API
百宝箱开放平台 ✖️ 开发流程
本文介绍通过开放平台集成智能体能力的流程,包括创建发布应用、获取授权令牌及调用API/SDK三步。涵盖智能体调用、模型测评、文件操作等接口,并提供Java、Python、Node.js及Web SDK支持,助力开发者快速实现智能对话与内容生成功能集成。(239字)
434 0
百宝箱开放平台 ✖️ 开发流程
|
存储 Docker 容器
企业实战(6)修改Harbor镜像仓库默认存储路径
企业实战(6)修改Harbor镜像仓库默认存储路径
982 0
|
4月前
|
运维 监控 Java
JVM 诊断工具进阶使用指南:jcmd、jmap、async-profiler 实战
本文深入讲解jcmd、jmap、async-profiler等JVM诊断工具的进阶用法,结合实战案例,涵盖堆转储、内存泄漏分析、CPU性能瓶颈定位及锁竞争问题,助力开发者高效排查JVM问题,提升Java应用稳定性与性能表现。(238字)
478 1
|
JavaScript Java 测试技术
基于小程序的小说阅读器+springboot+vue.js附带文章和源代码设计说明文档ppt
基于小程序的小说阅读器+springboot+vue.js附带文章和源代码设计说明文档ppt
259 0
|
7月前
|
网络虚拟化 虚拟化 Docker
记一次Windows端口占用问题排查
netstat命令排查不出的Windows端口占用问题的解决方案,附快速排查脚本
704 0
|
9月前
|
人工智能 自然语言处理 算法
AI企业必看:最新结果标识合规要求及规范
随着《人工智能生成合成内容标识办法》及配套标准的发布,AI企业需快速掌握政策要求以确保合规运营。该办法明确指出,利用AI生成的内容(如文本、图片、音频、视频等)需通过显性标识(如“AI生成”字样)或隐性标识(如元数据、数字水印)进行标注。内容传播平台也需核验标识并提醒用户内容性质。此外,应用程序分发平台在审核时需确认是否提供AI生成服务及相关标识材料。对于AI企业而言,合规已成为必修课,需重点关注标识的规范性和溯源能力,以应对即将到来的监管要求。
|
机器学习/深度学习 自然语言处理 搜索推荐
Multi-Agent
基于Multi-Agent架构的智能导购助手,通过多个智能代理的协同工作,实现了顾客需求收集、商品匹配、个性化推荐及自动化交易的全流程自动化。该系统利用自然语言处理、机器学习、大数据等技术,显著提升顾客购物体验和商家运营效率,具有广泛的商业应用前景。
|
数据采集 人工智能 自然语言处理
阿里云百炼产品月刊【2024年11月】
11月,阿里云百炼平台迎来一系列重大更新,包括推出QwQ、qwen-turbo、qwen-Plus等多个新模型及快照版本,强化AI推理、文本生成、视觉理解等能力。此外,还优化了模型管理、数据处理等功能,提升了用户体验。
1770 0
|
机器学习/深度学习 人工智能 数据可视化
|
人工智能 搜索推荐 UED
Bot 商店 + 一键优化提示词 Prompt,开启AI新体验!| Botnow上新
Botnow 迎来了重大更新,新增了 Bot 商店功能,并优化了 Bot 编排,提升了 AI 使用效率。用户可在 Bot 商店中轻松浏览和体验各类官方及用户发布的 Bots,并可一键发布或下架自己的 Bot。此外,还推出了一键优化 Prompt 功能,帮助用户生成清晰、精准的指令,提升对话质量。新老用户快来体验吧![链接]
618 5