rosemarYuan commented on code in PR #887:
URL: https://github.com/apache/flink-agents/pull/887#discussion_r3690241768
##########
runtime/src/main/java/org/apache/flink/agents/runtime/context/RunnerContextImpl.java:
##########
@@ -118,17 +154,44 @@ public RunnerContextImpl(
this.mailboxThreadChecker = mailboxThreadChecker;
this.agentPlan = agentPlan;
this.resourceCache = resourceCache;
+ this.memoryEventSettings =
MemoryEventSettings.from(agentPlan.getConfigData());
}
public void setLongTermMemory(InteranlBaseLongTermMemory ltm) {
this.ltm = ltm;
}
- public void switchActionContext(String actionName, MemoryContext
memoryContext, String key) {
+ public void switchActionContext(
+ String actionName,
+ MemoryContext memoryContext,
+ String ltmPartitionKey,
+ @Nullable String eventKeyText,
+ boolean observationSuppressed) {
this.actionName = actionName;
this.memoryContext = memoryContext;
+ this.ltmPartitionKey = ltmPartitionKey;
+ this.eventKeyText = eventKeyText;
+ this.observationSuppressed = observationSuppressed;
+ boolean observationAllowed = !observationSuppressed && eventKeyText !=
null;
+ boolean updateObservationEnabled =
+ observationAllowed
+ && memoryEventSettings.generate(
+ MemoryEventSettings.MemoryOp.LONG_TERM_UPDATE);
+ boolean getObservationEnabled =
+ observationAllowed
+ &&
memoryEventSettings.generate(MemoryEventSettings.MemoryOp.LONG_TERM_GET);
+ boolean searchObservationEnabled =
+ observationAllowed
+ && memoryEventSettings.generate(
+ MemoryEventSettings.MemoryOp.LONG_TERM_SEARCH);
+ this.ltmObservationEnabled =
Review Comment:
Thanks for the detailed review. I’ve addressed all comments .
- The logical key is now resolved once per run and reused for both the LTM
context and framework events.
- I also removed the duplicate Python context switch, aligned the LTM
interfaces, removed the redundant guard, and moved observation configuration to
LTM initialization.
- I added focused tests and documented the textual-key and compatibility
limits.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]