Repository navigation
Closed
Labels
bugSomething isn't working
Description
问题描述
问题
TypeSafe 官方 SytemOne 协议文档指出 noul 类型的 Questions 需要添加 criteria
源码中 noul 类型判断,只有 instructions,没有 criteria,如下图
导致部分兼容性协议没法调用。例如使用 书生端砚平台的 SytemOne 协议接口就会出问题,报错 400。
相关链接
- 书生端砚 https://discovery.intern-ai.org.cn/
- 书生端砚 SystemOne 协议文档 https://discovery.intern-ai.org.cn/token-plan/home?tabIndex=3&dockey=06-systemone.md 见
noul(是非题)部分 - TypeSafe 官方文档页面 https://docs.typesafe.ai/api/system-one 见
questions部分
建议的调用方式示例
- curl 示例
curl https://discovery-api.intern-ai.org.cn/v1/systemone \
--request POST \
--header "Authorization: Bearer {{YOUR_API_KEY}}" \
--header "Content-Type: application/json" \
--data '{
"model": "{{MODEL}}",
"state": {
"message": "Please end my monthly plan after this billing period."
},
"questions": {
"cancellation": {
"type": "noul",
"instructions": "Does the message explicitly request cancellation of a subscription?",
"criteria": {
"true": "",
"false": ""
}
}
}
}'
- 正常响应示例
HTTP/1.1 200 OK
content-type: application/json
traceparent: 00-5709a7df5bdb388b99ca863c013c7acb-1c73c23d5e5e60d1-01
x-request-id: req_8f59c1f8-0f07-4b8e-a9d6-b0071ace5a6c
date: Sun, 01 Nov 2026 06:35:51 GMT
content-length: 203
req-cost-time: 190
req-arrive-time: 1793514951395
resp-start-time: 1793514951585
x-envoy-upstream-service-time: 189
server: istio-envoy
connection: close
{
"answers": {
"cancellation": {
"type": "noul",
"noul": 0.7318060918170457
}
},
"model": "intern-decision-4b",
"request_id": "req_8f59c1f8-0f07-4b8e-a9d6-b0071ace5a6c",
"usage": {
"input_tokens": 179,
"output_tokens": 12
}
}- 若未带 criteria 的响应示例
HTTP/1.1 400 Bad Request
content-type: application/json; charset=utf-8
traceparent: 00-96baa35be27b7214c7243fae0221be8c-3347ad43fad4bd97-01
x-request-id: req_9307344d-b58f-4d3d-ad80-0f8478c47a47
date: Sun, 01 Nov 2026 06:49:30 GMT
content-length: 286
req-cost-time: 5
req-arrive-time: 1793515770188
resp-start-time: 1793515770194
x-envoy-upstream-service-time: 5
server: istio-envoy
connection: close
{
"error": {
"message": "question \"cancellation\" field `criteria` must be an object with `true`/`false` keys",
"type": "invalid_request_error",
"param": null,
"code": "invalid_request_error",
"trace_id": "96baa35be27b7214c7243fae0221be8c"
},
"request_id": "req_9307344d-b58f-4d3d-ad80-0f8478c47a47"
}如何复现?
在模型提供商页面,选判断,填好模型,点击测试会报错 400
AstrBot 版本
v4.29.4
操作系统
Windows
部署方式
Windows 桌面,使用 uv 部署
使用的消息平台适配器
onebot v11
错误日志
[14:32:43.352] [Core] [ERRO] [v4.29.4] [sources.system_one_decision_source:194]: [System One Decision] HTTP 400 from https://discovery-api.intern-ai.org.cn/v1/systemone
[14:34:06.733] [Core] [ERRO] [v4.29.4] [sources.system_one_decision_source:194]: [System One Decision] HTTP 400 from https://discovery-api.intern-ai.org.cn/v1/systemone
[14:34:13.746] [Core] [ERRO] [v4.29.4] [sources.system_one_decision_source:194]: [System One Decision] HTTP 400 from https://discovery-api.intern-ai.org.cn/v1/systemone
辅助信息
No response
检查清单
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Type
Projects
- StatusShow more project fieldsDone
Activity
dosubot commentedon Nov 1, 2026
你好 @AlionSSS!我是 Dosu,正在协助 AstrBotTeam 团队。
请求构造确实缺少
criteria:SystemOneDecisionProvider.ask()的noul分支只发送type和instructions,现有测试也将不含criteria的请求作为预期结果。[1] [2]不过,TypeSafe 当前文档将
criteria描述为object | null,未标为必填,并给出了省略该字段的noul示例。因此更准确的定位是与书生端砚接口的兼容性差异,而不能直接认定所有 SystemOne 接口都要求它。[3]建议修复方向:先按你提供的成功请求,在
noul分支补充"criteria": {"true": "", "false": ""},并同步更新请求体测试。当前DecisionBooleanQuestion也只有instructions字段,如果后续需要自定义是非判据,还需扩展该数据模型。[1] [2] [4]另一个需要区分的点:你贴出的 400 文案是 JSON 语法解析错误,并非明确的“缺少 criteria”。复测时应保证删去
criteria后没有留下尾逗号,这样才能排除 JSON 格式本身的影响。To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
AlionSSS commentedon Nov 1, 2026
之前
若未带 criteria 的响应示例填错了,已修改。fix(provider): support optional System One boolean criteria (AstrBotD…