资讯 文档
技术能力
语音技术
文字识别
人脸与人体
图像技术
语言与知识
视频技术

题目解析

概述

基于题目和题目对应答案,结合搜索内容,生成试题答案解析。该组件为付费功能,具体计费说明请参见使用文档。

接口定义

URL https://qianfan.baidubce.com/v2/tools/ai_education/question_analysis
Method POST

Headers

字段
Authorization Bearer {ApiKey}
Content-Type application/json
X-Appbuilder-Request-Id 非必填项(建议填写,方便后续链路问题排查,UUID格式)

请求参数

字段 类型 必填 说明
stream bool 是否流式返回。可选值:
true:流式。
false:非流式。
parameters dict 调用传参,具体见下文Parameters对象定义

Parameters对象

字段 类型 必填 说明
query string 题目和题目对应答案内容

请求示例

curl --request POST \
  --url https://qianfan.baidubce.com/v2/tools/ai_education/question_analysis \
  --header 'authorization: Bearer ***' \
  --header 'content-type: application/json' \
  --data '{
      "stream": false,
      "parameters": {
          "query": "题目和题目对应答案"
      }
  }'

响应参数

正确响应

字段 类型 必填 说明
requestId string 请求ID
code string 错误代码,当发生异常时返回
message string 错误消息,当发生异常时返回
status string 当前对话状态。
running:对话进行过程中。
done:对话结束。
error:执行过程发生错误。
interrupt:中断
content list[Content] 当前组件返回内容的主要payload,List[Content],每个 Content 包括了当前 event 的一个元素,具体见下文Content对象定义。

Content对象

字段 类型 必填 说明
type string 代表event 类型。该字段的取值决定了下面text字段的内容结构。
枚举值:
text、json、code、files、urls、oral_text、references、image、chart、audio、function_call。
text dict object 代表当前 event 元素的内容,每一种 event 对应的 text 结构固定。
event dict 标识返回内容的结构、顺序、状态,具体见下文Event对象定义。

text

字段 类型 必填 说明
data string 题目解析答案内容,数据格式根据type字段来决定,如果type是json ,这里就是json 字符串

Event

字段 类型 必填 说明
status string 事件执行状态。
枚举值:
preparing:运行中。
running:运行中。
error:错误。
done:执行完成。
error_code string 错误码。
error_message string 错误细节。

响应示例

{
    "code": "",
    "message": "",
    "status": "done",
    "content": [
        {
            "type": "json",
            "text": {
                "data": "{\"result\":\"\\n根据斐波那契数列的定义和递推关系,对题目解析如下:\\n\\n#### 【考点直击】  \\n**斐波那契数列的定义与递推计算**  \\n本题考查斐波那契数列的基本定义(第1、2项为1,后续项为前两项之和)以及通过递推关系逐步求解指定项的计算能力。\\n\\n#### 【题目解析】  \\n斐波那契数列的递推公式为:  \\n$$F(n) = F(n-1) + F(n-2)$$  \\n其中初始条件为 $F(1) = 1$,$F(2) = 1$  \\n需按顺序逐步计算至第10项:  \\n1. $F(3) = F(2) + F(1) = 1 + 1 = 2$  \\n2. $F(4) = F(3) + F(2) = 2 + 1 = 3$  \\n3. $F(5) = F(4) + F(3) = 3 + 2 = 5$  \\n4. $F(6) = F(5) + F(4) = 5 + 3 = 8$  \\n5. $F(7) = F(6) + F(5) = 8 + 5 = 13$  \\n6. $F(8) = F(7) + F(6) = 13 + 8 = 21$  \\n7. $F(9) = F(8) + F(7) = 21 + 13 = 34$  \\n8. $F(10) = F(9) + F(8) = 34 + 21 = 55$  \\n\\n> **答案**:第10个斐波那契数为 **55**。\"}"
            },
            "event": {
                "status": "done",
                "error_code": "",
                "error_message": ""
            }
        }
    ],
    "requestId": "11b1a01e-8342-4cbb-8690-10116e1f4c31"
}

异常响应

字段 类型 是否必填 说明
requestId string 请求ID
code string 0 表示成功,其他都是异常
message string 错误消息
detail 异常详情信息
上一篇
高中作文图片智能识别
下一篇
作文润色