[Bug] 决策模型协议 SystemOne 的 noul 类型请求未兼容标准格式

Đang mở
#10,920 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@mothieras đang làm issue này rồi.

Từ ngày 9/11/2026.

  • #10930 của @AlionSSS — đã đóng, không merge
  • #11062 của @mothieras — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
50/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
ai, api

Hướng nghiên cứu

The failing call goes through sources.system_one_decision_source, where the HTTP 400 is logged around line 194. Find the branch that builds the payload for noul questions and check that it adds a criteria object with true and false keys, as the TypeSafe SystemOne docs require. Done means a noul request with only instructions gets a valid criteria and no longer returns 400. A closed, unmerged pull request (#10930) is already linked, so read its discussion before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
问题描述

问题

TypeSafe 官方 SytemOne 协议文档指出 noul 类型的 Questions 需要添加 criteria
源码中 noul 类型判断,只有 instructions,没有 criteria,如下图

Image

导致部分兼容性协议没法调用。例如使用 书生端砚平台的 SytemOne 协议接口就会出问题,报错 400。

相关链接

建议的调用方式示例

  • 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

Image
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

检查清单
  • 我已在 Issue 列表中搜索过相关问题仍无法解决,或该问题从未被报告过。
  • 我已尝试过禁用所有插件,排除了可能是因插件导致的问题。
  • 我报告的问题与 AstrBot 本体相关,而非在报告某一插件的问题。
  • 我已阅读并同意本项目的贡献者行为准则。
  • (可选)我愿意提交 PR 以帮助修复该问题。
Ngôn ngữ chính
Python
Star
46.4k
Fork
3.4k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
120

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AstrBotDevs/AstrBot

Tất cả issue của AstrBotDevs/AstrBot

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.