Files
DeepTutor/web/lib/graphrag-model-compatibility.ts
Lan-zk 3f1894e0c4 fix(knowledge): harden GraphRAG model and embedding compatibility (#747)
* fix(knowledge): add GraphRAG model compatibility layer

* fix(graphrag): harden compatibility preflight

* fix: align GraphRAG compatibility with current dev

* test: skip GraphRAG config test without optional extra

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-08-17 01:12:05 +08:00

23 lines
571 B
TypeScript

import type { GraphRagModelCompatibility } from "@/lib/knowledge-api";
export interface GraphRagCandidateGate {
activeKey: string;
candidateKey: string;
testedKey: string | null;
result: GraphRagModelCompatibility | null;
}
/** A successful probe is valid only for the exact, not-yet-active candidate. */
export function canApplyGraphRagModelCandidate({
activeKey,
candidateKey,
testedKey,
result,
}: GraphRagCandidateGate): boolean {
return (
candidateKey !== activeKey &&
testedKey === candidateKey &&
result?.compatible === true
);
}