| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <?php
- return [
- /*
- |--------------------------------------------------------------------------
- | AI Service Configuration
- |--------------------------------------------------------------------------
- */
- 'driver' => env('AI_DRIVER', 'deepseek'),
- 'deepseek' => [
- 'api_key' => env('DEEPSEEK_API_KEY'),
- 'base_url' => 'https://api.deepseek.com/v1',
- 'model' => 'deepseek-chat',
- 'timeout' => 30,
- ],
- 'openai' => [
- 'api_key' => env('OPENAI_API_KEY'),
- 'base_url' => 'https://api.openai.com/v1',
- 'model' => 'gpt-3.5-turbo',
- 'timeout' => 30,
- ],
- 'question_detection_prompt' => <<<'PROMPT'
- 请判断下面这段 Markdown 是否是一道数学题目。
- 判断逻辑:
- - 若包含题号(例:1. 2. 3.)
- - 或包含数学公式、括号空格(___)、选项(A. B.)
- - 或包含题图
- 非题目内容包括:知识点介绍、章节标题、教材说明、前言、目录、示例说明。
- 题目内容:
- {content}
- 请输出 JSON 格式:
- {
- "is_question": true|false,
- "confidence": 0 ~ 1
- }
- PROMPT,
- 'question_parse_prompt' => <<<'PROMPT'
- 你是一名“数学题目结构化解析器”。请把下面这段 Markdown 解析成一条题目候选的结构化 JSON。
- 要求:
- - 只输出 JSON,不要输出其它文本
- - 必须包含字段:index, stem, options, images, tables, is_question_candidate, ai_confidence
- - index 为题号(整数);若无法识别,则使用输入 index
- - stem 为题干字符串(保留 Markdown/LaTeX)
- - options 为对象,key 为 A/B/C/D...(若没有选项则为 null)
- - images 为数组,包含图片 URL(Markdown 图片或 <img src="">)
- - tables 为数组,包含表格 HTML 或 Markdown 表格原文
- - is_question_candidate 为布尔值:是否为“可进入候选库”的题目
- - ai_confidence 为 0~1 的浮点数
- 输入 index: {index}
- 输入内容:
- {content}
- 输出 JSON 示例:
- {
- "index": 1,
- "stem": "....",
- "options": {"A": "...", "B": "..."},
- "images": ["https://..."],
- "tables": [],
- "is_question_candidate": true,
- "ai_confidence": 0.82
- }
- PROMPT,
- 'knowledge_match_prompt' => <<<'PROMPT'
- 你是一名数学知识点匹配器。给定题目内容与知识点候选列表,输出最相关的知识点。
- 要求:
- - 只输出 JSON,不要输出其它内容
- - 输出字段为 knowledge_points 数组,每个元素包含 kp_code 与 weight (0~1)
- - 若无法匹配,返回空数组
- 题目内容:
- {question}
- 候选列表:
- {candidates}
- 输出 JSON 示例:
- {
- "knowledge_points": [
- {"kp_code": "A01", "weight": 0.82},
- {"kp_code": "B03", "weight": 0.45}
- ]
- }
- PROMPT,
- 'solution_steps_prompt' => <<<'PROMPT'
- 你是一名数学解题专家,请为题目生成“分步骤评分解题过程”。
- 要求:
- - 只输出 JSON
- - steps 为数组,每一步包含:
- - step_index: 从 1 开始
- - title: 本步标题
- - content: 本步解释
- - score: 本步分值(数字)
- - kp_codes: 与本步相关的知识点数组
- 题目内容:
- {question}
- 输出 JSON 示例:
- {
- "solution": "整体解题思路概述",
- "steps": [
- {"step_index": 1, "title": "...", "content": "...", "score": 4, "kp_codes": ["A01"]},
- {"step_index": 2, "title": "...", "content": "...", "score": 6, "kp_codes": ["B02", "C03"]}
- ]
- }
- PROMPT,
- 'question_generation_prompt' => <<<'PROMPT'
- 你是一名“数学题目完善助手”。给定原题干与可选图片外链,请补全题目关键信息并做轻量修订。
- 要求:
- - 只输出 JSON
- - 必须包含字段:stem, options, answer, solution, question_type, difficulty, knowledge_points, solution_steps
- - 可选字段:abilities(能力/技能点数组)
- - stem 只做轻微修订(排版/符号/错别字),不得改题意
- - 若提供图片外链(image_urls),可结合图片理解题意,但不要生成 SVG
- - question_type 仅允许:choice / fill / answer
- - answer 类题目必须提供 solution_steps(分步评分),每步包含 score 与 kp_codes
- - knowledge_points 为题目级知识点列表
- 材料内容(含题干与图片):
- {content}
- 输出 JSON 示例:
- {
- "stem": "...",
- "options": {"A": "...", "B": "..."},
- "answer": "...",
- "solution": "...",
- "question_type": "answer",
- "difficulty": 0.6,
- "knowledge_points": ["A01"],
- "solution_steps": [
- {"step_index": 1, "title": "...", "content": "...", "score": 4, "kp_codes": ["A01"]}
- ],
- "abilities": ["计算能力", "分析能力"]
- }
- PROMPT,
- ];
|