---
title: "Bocha Jev"
description: "根据共享上下文，为候选选择、等级评分或真假判断返回结构化决策结果。"
slug: "/api-reference/bocha-jev"
version: "1.0.0"
source: "https://jev.bocha.cn/v1/systemone"
---

# Bocha Jev

## 接口信息

- **请求方式**：`POST`
- **接口路径**：`/v1/systemone`
- **完整地址**：`https://jev.bocha.cn/v1/systemone`

根据共享上下文，为候选选择、等级评分或真假判断返回结构化决策结果。

## OpenAPI 定义

~~~yaml
/v1/systemone:
    post:
      # Jev 与搜索 API 使用不同域名。将服务地址写在操作级别，Mintlify 在线调试会直连
      # 该地址，同时不影响既有搜索接口继续使用顶层的 api.bocha.cn 服务地址。
      servers:
        - url: https://jev.bocha.cn
          description: Jev 生产环境
      summary: Jev 结构化决策
      operationId: jevSystemone
      description: 对共享上下文执行候选选择、等级评分或真假判断；接口不生成自然语言，也不支持流式输出。
      tags:
        - Jev
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/JevSystemoneRequest"
            examples:
              structuredDecision:
                summary: 同时执行路由、判断和评分
                value:
                  model: bocha-jev-v1
                  state: 我的订单被重复扣款，请退还多收的费用。
                  questions:
                    department:
                      type: choice
                      instructions: 选择负责团队。
                      criteria:
                        billing: 账单、付款、退款
                        technical: 技术故障
                        sales: 采购咨询
                    refund:
                      type: noul
                      instructions: 客户是否要求退款？
                    relevance:
                      type: score
                      instructions: 这条消息与退款处理的相关程度？
                      criteria:
                        - 无关
                        - 间接相关
                        - 直接相关
      responses:
        "200":
          description: 决策成功
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/JevSystemoneResponse"
              example:
                model: bocha-jev-v1
                answers:
                  department:
                    type: choice
                    choice: billing
                    probabilities:
                      billing: 0.88
                      technical: 0.04
                      sales: 0.08
                    confidence: 0.88
                  refund:
                    type: noul
                    noul: 0.98
                  relevance:
                    type: score
                    score: 1.93
                    probabilities:
                      "0": 0.02
                      "1": 0.03
                      "2": 0.95
                    confidence: 0.95
                    legend:
                      "0": 无关
                      "1": 间接相关
                      "2": 直接相关
                usage:
                  input_tokens: 348
                  output_tokens: 0
                metadata:
                  inference_ms: 185.36
                  cuda_graph_enabled: true
                  checkpoint_status: experimental
                  calibrated: true
                  confidence_definition: maximum candidate probability; not guaranteed correctness
        "400":
          description: 请求格式错误
        "401":
          description: 鉴权失败，API Key 缺失或无效
        "413":
          description: 原始请求体超过 256 KiB
        "415":
          description: Content-Type 不支持；请使用 application/json
        "422":
          description: 模型、字段、问题数、候选数、规范化大小或每问题输入长度不符合要求
        "429":
          description: 调用频率超过限额；响应可能包含 Retry-After
        "500":
          description: 服务内部错误
        "503":
          description: 服务暂时不可用；响应可能包含 Retry-After
        "529":
          description: 模型繁忙；响应可能包含 Retry-After

    JevSystemoneRequest:
      type: object
      additionalProperties: false
      required:
        - state
        - questions
      properties:
        model:
          type: string
          default: bocha-jev-v1
          description: 模型 ID；可使用 bocha-jev-v1、bocha-jev-latest 或 jev-latest，省略时使用默认模型。
        state:
          description: 所有问题共享的上下文；根节点必须为字符串、对象或数组，不能为数字、布尔值或 null。
          oneOf:
            - type: string
            - type: object
            - type: array
        questions:
          type: object
          # 新版模型按单个问题计算输入上限：共享 state、指令、提示模板和该问题的全部候选共同占用 32K tokens。
          # 多个问题分别计限，因此整次请求的 input_tokens 累计值可以超过单问题上限。
          description: 调用方自定义的问题 ID 到问题定义的映射；每次请求包含 1 至 32 个问题，每个问题的总输入最多 32K tokens。
          minProperties: 1
          maxProperties: 32
          additionalProperties:
            oneOf:
              - $ref: "#/components/schemas/JevChoiceQuestion"
              - $ref: "#/components/schemas/JevScoreQuestion"
              - $ref: "#/components/schemas/JevNoulQuestion"

    JevSystemoneResponse:
      type: object
      required:
        - model
        - answers
        - usage
        - metadata
      properties:
        model:
          type: string
          description: 实际使用的模型 ID。
        answers:
          type: object
          description: 问题 ID 到答案的映射；答案结构由对应问题类型决定。
          additionalProperties:
            oneOf:
              - $ref: "#/components/schemas/JevChoiceAnswer"
              - $ref: "#/components/schemas/JevScoreAnswer"
              - $ref: "#/components/schemas/JevNoulAnswer"
        usage:
          type: object
          required: [input_tokens, output_tokens]
          properties:
            input_tokens:
              type: integer
              description: 全部候选展开后的输入 token 累计值。
            output_tokens:
              type: integer
              const: 0
              description: 当前模型固定为 0，因为接口不生成文本。
        metadata:
          type: object
          properties:
            inference_ms:
              type: number
              description: 模型前向推理耗时，单位为毫秒。
            cuda_graph_enabled:
              type: boolean
            checkpoint_status:
              type: string
            calibrated:
              type: boolean
            confidence_definition:
              type: string

    JevChoiceQuestion:
      type: object
      additionalProperties: false
      required:
        - type
        - criteria
      properties:
        type:
          type: string
          const: choice
          description: 从候选项中选择一项。
        instructions:
          $ref: "#/components/schemas/JevInstruction"
        criteria:
          type: object
          description: 候选 ID 到候选内容的映射；候选 ID 会原样返回。
          minProperties: 2
          maxProperties: 255
          additionalProperties: {}

    JevScoreQuestion:
      type: object
      additionalProperties: false
      required:
        - type
        - criteria
      properties:
        type:
          type: string
          const: score
          description: 根据有序等级评分；等级索引从 0 开始。
        instructions:
          $ref: "#/components/schemas/JevInstruction"
        criteria:
          type: array
          description: 按低到高排序的评分等级。
          minItems: 1
          maxItems: 10
          items: {}

    JevNoulQuestion:
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          const: noul
          description: 判断条件是否成立，返回为真的概率。
        instructions:
          $ref: "#/components/schemas/JevInstruction"
        criteria:
          type:
            - object
            - "null"
          description: 可省略；对象仅可包含 false、true 键，缺失或 null 的一侧使用默认描述。
          additionalProperties: false
          properties:
            "false": {}
            "true": {}

    JevChoiceAnswer:
      type: object
      required: [type, choice, probabilities, confidence]
      properties:
        type:
          type: string
          const: choice
        choice:
          type: string
          description: 被选中的候选 ID。
        probabilities:
          type: object
          description: 候选 ID 到概率的映射；各概率合计约为 1。
          additionalProperties:
            type: number
            minimum: 0
            maximum: 1
        confidence:
          type: number
          minimum: 0
          maximum: 1
          description: 最高候选概率，不等同于结果正确率。

    JevScoreAnswer:
      type: object
      required: [type, score, probabilities, legend, confidence]
      properties:
        type:
          type: string
          const: score
        score:
          type: number
          description: 等级索引的概率加权平均值。
        probabilities:
          type: object
          additionalProperties:
            type: number
            minimum: 0
            maximum: 1
        legend:
          type: object
          description: 等级索引到原始等级描述的映射。
          additionalProperties: {}
        confidence:
          type: number
          minimum: 0
          maximum: 1
          description: 最高等级概率，不等同于结果正确率。

    JevNoulAnswer:
      type: object
      required: [type, noul]
      properties:
        type:
          type: string
          const: noul
        noul:
          type: number
          minimum: 0
          maximum: 1
          description: 判断为真的概率；判断为假的概率为 1 - noul。

    JevInstruction:
      description: 决策指令；字符串最多 8192 个字符，对象和数组会 JSON 序列化后参与模型输入。
      oneOf:
        - type: string
          maxLength: 8192
        - type: object
        - type: array
        - type: "null"

~~~
