mirror of
https://github.com/langgenius/dify.git
synced 2026-09-05 00:31:19 +08:00
fix(knowledge-fs): skip retrieval model probes on settings save
This commit is contained in:
parent
6ee5f59da8
commit
24c1fe7138
@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 5,
|
||||
"subtreeTree": "507cdba8b451cc907f027ca64f1bab468b858e3f",
|
||||
"subtreeTree": "d89aa89a543c1c1a5b3d042881597d9af2a1a47b",
|
||||
"openapiSha256": "47936a7d9ffdc27e2b2b8982a90e1936dc3bf59a64c316f452a6912ec1d2fcd6",
|
||||
"capabilityV2AuthManifestSha256": "fc0a47e23cce12544882f0298522b4933002e892b84ce1815df7e81d36a7a0c7",
|
||||
"capabilityV2AuthTestVectorSha256": "ae0de37b1ff05c40f905cf17a7b410d8971acacf64db07d5ee3d6fecfa559ce3",
|
||||
|
||||
@ -2173,14 +2173,14 @@ async function preflightKnowledgeSpaceModels({
|
||||
const [embeddingSnapshot, reasoningSnapshot, rerankSnapshot] = await Promise.all([
|
||||
embedding ? preflight.verify({ kind: "embedding", selection: embedding, tenantId }) : undefined,
|
||||
retrievalProfile
|
||||
? preflight.verify({
|
||||
? resolveConfiguredModelCapability(preflight, {
|
||||
kind: "reasoning",
|
||||
selection: retrievalProfile.reasoningModel,
|
||||
tenantId,
|
||||
})
|
||||
: undefined,
|
||||
retrievalProfile?.rerank.enabled && retrievalProfile.rerank.model
|
||||
? preflight.verify({
|
||||
? resolveConfiguredModelCapability(preflight, {
|
||||
kind: "rerank",
|
||||
selection: retrievalProfile.rerank.model,
|
||||
tenantId,
|
||||
@ -2194,6 +2194,13 @@ async function preflightKnowledgeSpaceModels({
|
||||
};
|
||||
}
|
||||
|
||||
function resolveConfiguredModelCapability(
|
||||
preflight: ModelCapabilityPreflight,
|
||||
input: Parameters<ModelCapabilityPreflight["verify"]>[0],
|
||||
): Promise<ModelCapabilitySnapshot> {
|
||||
return preflight.resolveConfigured ? preflight.resolveConfigured(input) : preflight.verify(input);
|
||||
}
|
||||
|
||||
function embeddingVectorSpaceIdentityFromSnapshot(snapshot: ModelCapabilitySnapshot) {
|
||||
if (
|
||||
snapshot.kind !== "embedding" ||
|
||||
|
||||
@ -281,12 +281,20 @@ function publishedProfileApp(
|
||||
},
|
||||
knowledgeSpaceProfiles: profiles,
|
||||
modelCapabilityPreflight: {
|
||||
verify: async (input) =>
|
||||
resolveConfigured: async (input) =>
|
||||
capability(input.kind, {
|
||||
model: input.selection.model,
|
||||
pluginId: input.selection.pluginId,
|
||||
provider: input.selection.provider,
|
||||
}),
|
||||
verify: async (input) =>
|
||||
input.kind === "embedding"
|
||||
? capability(input.kind, {
|
||||
model: input.selection.model,
|
||||
pluginId: input.selection.pluginId,
|
||||
provider: input.selection.provider,
|
||||
})
|
||||
: Promise.reject(new Error("Retrieval settings must not invoke configured models")),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user