基于现有题目生成变式题,支持多种变换类型。支持选择题、填空题、简答题等多种题型。
| 请求URL | POST /api/similar 或 GET /api/similar |
| 请求方法 | POST / GET |
| 认证方式 | API Key(请求头:X-API-Key) |
| 参数名 | 必填 | 类型 | 说明 |
|---|---|---|---|
question |
是 | string | 原题目内容 |
options |
否 | string | 原题目的选项,每个选项占一行 |
type |
否 | string | 题型,默认为 single。支持的题型包括: 基础题型:single(单选题), multiple(多选题), judgement(判断题), fill(填空题), short_answer(简答题), calculation(计算题), essay(论述题), coding(编程题) 高考题型:reading_comprehension(阅读理解), material_analysis(材料分析题), cloze_test(完形填空), translation(翻译题), writing(写作题), continuation_writing(读后续写), summary_writing(概要写作), error_correction(改错题), grammar(语法题), vocabulary(词汇题), paragraph_ordering(段落排序题), listening_comprehension(听力理解) |
count |
否 | integer | 生成相似题数量,默认为3,最大为10 |
similarity_level |
否 | string | 相似度级别,默认为 medium。可选值:low(轻微变化), medium(中等变化), high(较大变化) |
variation_type |
否 | string | 变化类型,默认为 comprehensive。可选值:numerical(数字和数据变化), contextual(情境和背景变化), expression(表述和措辞变化), structure(结构和逻辑变化), comprehensive(综合变化) |
{
"question": "已知函数f(x)=x²+2x+1,求f(x)的最小值。",
"options": "A. 0\nB. 1\nC. 2\nD. 3",
"type": "single",
"count": 3,
"similarity_level": "medium",
"variation_type": "numerical"
}
curl -X GET \
-H "X-API-Key: your_api_key" \
"https://tiku.anevol.cn/api/similar?question=已知函数f(x)=x²+2x+1,求f(x)的最小值。&type=single&count=3&similarity_level=medium&variation_type=numerical"
{
"question": "地球是太阳系中最大的行星",
"type": "judgement",
"count": 2,
"similarity_level": "high",
"variation_type": "contextual"
}
| 参数名 | 类型 | 说明 |
|---|---|---|
code |
integer | 状态码,1表示成功,0表示失败 |
original_question |
string | 原题目内容 |
question_type |
string | 题型 |
similarity_level |
string | 相似度级别 |
variation_type |
string | 变化类型 |
count |
integer | 生成数量 |
similar_questions |
string | 生成的相似题内容(字符串格式,多题用 --- 分隔)(成功时返回) |
model |
string | 使用的AI模型名称(成功时返回) |
using_backup |
boolean | 是否使用了备用模型(可选,成功时可能返回) |
msg |
string | 错误信息(失败时返回) |
{
"code": 1,
"original_question": "已知函数f(x)=x²+2x+1,求f(x)的最小值。",
"question_type": "single",
"similarity_level": "medium",
"variation_type": "numerical",
"count": 3,
"similar_questions": "题目1:已知函数f(x)=x²+4x+4,求f(x)的最小值。\nA. 0\nB. 1\nC. 2\nD. 3\n正确答案:A\n---\n题目2:已知函数f(x)=x²+6x+9,求f(x)的最小值。\nA. 0\nB. 1\nC. 2\nD. 3\n正确答案:A\n---\n题目3:已知函数f(x)=x²+8x+16,求f(x)的最小值。\nA. 0\nB. 1\nC. 2\nD. 3\n正确答案:A",
"model": "deepseek-chat"
}
{
"code": 1,
"original_question": "地球是太阳系中最大的行星",
"question_type": "judgement",
"similarity_level": "high",
"variation_type": "contextual",
"count": 2,
"similar_questions": "题目1:木星是太阳系中最大的行星\n正确答案:正确\n---\n题目2:土星是太阳系中最大的行星\n正确答案:错误",
"model": "deepseek-chat"
}
{
"code": 0,
"msg": "请提供原题目内容"
}
| 错误码 | 说明 |
|---|---|
400 |
请求参数错误(如缺少必填参数 question) |
401 |
未提供API密钥或密钥无效 |
429 |
请求过于频繁,触发限流 |
500 |
服务器内部错误(AI模型调用失败等) |
count 参数控制,最大为 10 道similarity_level 影响题目变化程度:low 轻微变化,medium 中等变化,high 较大变化variation_type 控制变化方向:数字变化、情境变化、表述变化、结构变化或综合变化using_backup: true--- 分隔,每道题包含题目、选项(如有)和答案