mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-05 04:10:17 +08:00
fix(lightrag): validate base reasoning directly
This commit is contained in:
@@ -50,9 +50,18 @@ export function roleModelsValidationError(
|
||||
option.profile_id === selection?.profile_id &&
|
||||
option.model_id === selection?.model_id,
|
||||
);
|
||||
if (!findOption(models.base)) {
|
||||
const baseOption = findOption(models.base);
|
||||
if (!baseOption) {
|
||||
return "The LightRAG base model is unavailable. Choose an accessible model.";
|
||||
}
|
||||
if (
|
||||
models.base.reasoning_effort &&
|
||||
!baseOption.supported_reasoning_efforts?.includes(
|
||||
models.base.reasoning_effort,
|
||||
)
|
||||
) {
|
||||
return "The selected reasoning effort is no longer supported.";
|
||||
}
|
||||
for (const role of ["extract", "keyword", "query", "vlm"] as const) {
|
||||
const value = models[role];
|
||||
if (
|
||||
|
||||
@@ -102,6 +102,9 @@ describe("LightRAG role editor", () => {
|
||||
...textModel,
|
||||
reasoning_effort: "high",
|
||||
});
|
||||
invalidBaseReasoning.extract.reasoning_effort = "none";
|
||||
invalidBaseReasoning.keyword.reasoning_effort = "none";
|
||||
invalidBaseReasoning.query.reasoning_effort = "none";
|
||||
expect(roleModelsValidationError(invalidBaseReasoning, options)).toBe(
|
||||
"The selected reasoning effort is no longer supported.",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user