feat(shared-proto): ai/core_edu/iam proto v2 扩展

ai.proto: 新增 GenerateReport RPC + GenerateReportRequest/GeneratedReport message

core_edu.proto: 新增 ExtendExam/ForceSubmitExam/ReorderExamQuestions 3 RPC + message

iam.proto: 新增 CreateUser/UpdateUser/DeleteUser 3 RPC + 4 message
This commit is contained in:
SpecialX
2026-07-14 22:57:18 +08:00
parent 7545956202
commit 843b370b3d
3 changed files with 120 additions and 16 deletions

View File

@@ -23,6 +23,8 @@ service AiService {
rpc GetLessonPlanStatus(GetLessonPlanStatusRequest) returns (LessonPlanStatus);
// 教师确认备课结果入库(调 content.CreateQuestions
rpc ConfirmLessonPlan(ConfirmLessonPlanRequest) returns (ConfirmResult);
// 生成学情报告(班级总结 / 学生详情 / 考试分析)
rpc GenerateReport(GenerateReportRequest) returns (GeneratedReport);
}
// === 聊天 ===
@@ -33,11 +35,11 @@ message ChatRequest {
// 可选上下文ai12 增补BFF 透传用户身份与数据范围)
optional string user_id = 4;
optional string session_id = 5;
optional string data_scope = 6; // JSON 序列化的 DataScope
optional string data_scope = 6; // JSON 序列化的 DataScope
}
message ChatMessage {
string role = 1; // system / user / assistant
string role = 1; // system / user / assistant
string content = 2;
}
@@ -45,8 +47,8 @@ message ChatResponse {
string content = 1;
string model = 2;
Usage usage = 3;
bool degraded = 4; // 降级标记(方案 Bsuccess=true + data 内 degraded
string degraded_reason = 5; // 降级原因(如 llm_unavailable / redis_unavailable
bool degraded = 4; // 降级标记(方案 Bsuccess=true + data 内 degraded
string degraded_reason = 5; // 降级原因(如 llm_unavailable / redis_unavailable
}
message Usage {
@@ -65,12 +67,12 @@ message ChatChunk {
message GenerateQuestionRequest {
string prompt = 1;
string subject = 2;
string difficulty = 3; // easy / medium / hard
string difficulty = 3; // easy / medium / hard
// 扩展字段ai12 增补)
optional string grade = 4;
repeated string knowledge_point_ids = 5;
optional string question_type = 6; // single_choice / multi_choice / fill_blank / short_answer / essay
optional int32 count = 7; // 生成数量,默认 1
optional string question_type = 6; // single_choice / multi_choice / fill_blank / short_answer / essay
optional int32 count = 7; // 生成数量,默认 1
}
message GeneratedQuestion {
@@ -80,15 +82,15 @@ message GeneratedQuestion {
string question_type = 4;
string difficulty = 5;
repeated string knowledge_point_ids = 6;
optional double evaluation_score = 7; // 质量评分0.0-1.0,评估三道防线输出)
optional double evaluation_score = 7; // 质量评分0.0-1.0,评估三道防线输出)
bool degraded = 8;
string degraded_reason = 9;
}
message GeneratedQuestionChunk {
string content = 1; // 逐字内容
string content = 1; // 逐字内容
bool done = 2;
optional GeneratedQuestion complete_question = 3; // done=true 时携带完整题目
optional GeneratedQuestion complete_question = 3; // done=true 时携带完整题目
}
// === 表达优化 ===
@@ -109,15 +111,15 @@ message GenerateLessonPlanRequest {
string class_id = 1;
string subject_id = 2;
string topic = 3;
string target_difficulty = 4; // easy / medium / hard
string target_difficulty = 4; // easy / medium / hard
int32 question_count = 5;
string user_id = 6;
string data_scope = 7; // JSON 序列化的 DataScope
string data_scope = 7; // JSON 序列化的 DataScope
}
message LessonPlanResponse {
string workflow_id = 1;
string status = 2; // pending / analyzing / generating / pending_review / persisted / failed
string status = 2; // pending / analyzing / generating / pending_review / persisted / failed
int32 estimated_completion_seconds = 3;
bool degraded = 4;
string degraded_reason = 5;
@@ -138,7 +140,7 @@ message LessonPlanStatus {
message ConfirmLessonPlanRequest {
string workflow_id = 1;
map<string, string> modifications = 2; // question_id → 修改后内容(可选,教师审核修改)
map<string, string> modifications = 2; // question_id → 修改后内容(可选,教师审核修改)
}
message ConfirmResult {
@@ -146,3 +148,21 @@ message ConfirmResult {
repeated string persisted_question_ids = 2;
optional string error = 3;
}
// === 学情报告 ===
message GenerateReportRequest {
string class_id = 1;
string report_type = 2; // class_summary / student_detail / exam_analysis
optional string student_id = 3;
string user_id = 4;
string data_scope = 5; // JSON 序列化的 DataScope
}
message GeneratedReport {
string id = 1;
string content = 2; // 报告正文Markdown
string summary = 3; // 摘要
repeated string recommendations = 4; // 教学建议
bool degraded = 5;
string degraded_reason = 6;
}