feat(skills,knowledge): 中文名补全与知识库沉淀支持可选大模型并明确大模型报错

技能中文名:
- 单个「AI 生成」与「一键补充中文名」均可在请求体 model_name 选择大模型
- 一键补充改为仅管理员开放
- _generate_skill_name_zh 在模型自身失败(构建/超时/API 报错)时抛
  SkillNameZhModelError,与模型返回无效名称区分;单个接口返回
  502「大模型报错,无法补全技能中文名」,批量在 model_error 中带回代表性报错

知识库沉淀:
- 对话保存到知识库 / 批量导入均新增可选 model_name(透传至 capture_thread
  → extract_thread_llm_multi)
- 批量返回 llm_fallback 计数;模型异常时仍按既有逻辑回退规则抽取并落草稿,
  前端明确提示「已改用规则抽取」(保存按钮保持后台异步)

前端新增 components/workspace/model-name-select.tsx 复用下拉(默认=系统配置模型)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
吉鑫升andClaude Opus 4.8 committed 2026-06-10 11:23:01 +08:00
1 parent 8fbbfc8093
commit 96e0d695c0
11 files changed
+295 -83

No files matched your search

+12 -1
View File
@@ -101,6 +101,8 @@ export interface IngestThreadPayload {
include_sources?: boolean;
/** When true the backend sediments asynchronously and returns immediately. */
background?: boolean;
/** Optional model override for knowledge extraction (null = configured default). */
model_name?: string | null;
}
export interface BatchIngestPayload {
@@ -110,6 +112,8 @@ export interface BatchIngestPayload {
include_sources?: boolean;
skip_existing?: boolean;
mode?: "summary" | "full";
/** Optional model override for knowledge extraction (null = configured default). */
model_name?: string | null;
}
export interface BatchIngestResult {
@@ -118,7 +122,14 @@ export interface BatchIngestResult {
created: number;
skipped: number;
failed: number;
items: Array<{ thread_id: string; note_id: string | null; status: string }>;
/** Notes that fell back to rule-based extraction because the model failed. */
llm_fallback?: number;
items: Array<{
thread_id: string;
note_id: string | null;
status: string;
llm_fallback?: boolean;
}>;
}
export interface GraphExportResult {