mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +08:00
refactor(memory): remove module context and recall tracking
This commit is contained in:
@@ -47,7 +47,6 @@ public class MemorySelector extends AbstractAgentModule.Running<PartnerRunningFl
|
|||||||
List<ActivatedMemorySlice> activatedSlices = selectAndEvaluateMemory(runningFlowContext, extractorResult);
|
List<ActivatedMemorySlice> activatedSlices = selectAndEvaluateMemory(runningFlowContext, extractorResult);
|
||||||
memoryCapability.updateActivatedSlices(activatedSlices);
|
memoryCapability.updateActivatedSlices(activatedSlices);
|
||||||
}
|
}
|
||||||
setModuleContextRecall(runningFlowContext);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ActivatedMemorySlice> selectAndEvaluateMemory(PartnerRunningFlowContext runningFlowContext,
|
private List<ActivatedMemorySlice> selectAndEvaluateMemory(PartnerRunningFlowContext runningFlowContext,
|
||||||
@@ -67,14 +66,6 @@ public class MemorySelector extends AbstractAgentModule.Running<PartnerRunningFl
|
|||||||
return memorySlices;
|
return memorySlices;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setModuleContextRecall(PartnerRunningFlowContext runningFlowContext) {
|
|
||||||
boolean recall = memoryCapability.hasActivatedSlices();
|
|
||||||
runningFlowContext.getModuleContext().getExtraContext().put("recall", recall);
|
|
||||||
if (recall) {
|
|
||||||
runningFlowContext.getModuleContext().getExtraContext().put("recall_count", memoryCapability.getActivatedSlicesSize());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setMemoryCandidates(LinkedHashMap<String, ActivatedMemorySlice> candidates,
|
private void setMemoryCandidates(LinkedHashMap<String, ActivatedMemorySlice> candidates,
|
||||||
List<ExtractorMatchData> matches) {
|
List<ExtractorMatchData> matches) {
|
||||||
for (ExtractorMatchData match : matches) {
|
for (ExtractorMatchData match : matches) {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package work.slhaf.partner.runtime.interaction.data.context
|
|||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject
|
import com.alibaba.fastjson2.JSONObject
|
||||||
import work.slhaf.partner.api.agent.runtime.interaction.flow.RunningFlowContext
|
import work.slhaf.partner.api.agent.runtime.interaction.flow.RunningFlowContext
|
||||||
import work.slhaf.partner.runtime.interaction.data.context.subcontext.ModuleContext
|
|
||||||
|
|
||||||
class PartnerRunningFlowContext private constructor(
|
class PartnerRunningFlowContext private constructor(
|
||||||
override val source: String,
|
override val source: String,
|
||||||
@@ -45,7 +44,6 @@ class PartnerRunningFlowContext private constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val moduleContext = ModuleContext()
|
|
||||||
val coreResponse = JSONObject()
|
val coreResponse = JSONObject()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user