File tree Expand file tree Collapse file tree 2 files changed +308
-328
lines changed
spring-ai-alibaba-graph-core/src
main/java/com/alibaba/cloud/ai/graph/agent
test/java/com/alibaba/cloud/ai/graph/agent Expand file tree Collapse file tree 2 files changed +308
-328
lines changed Original file line number Diff line number Diff line change @@ -207,21 +207,22 @@ private StateGraph initGraph() throws GraphStateException {
207
207
if (keyStrategyFactory == null ) {
208
208
this .keyStrategyFactory = () -> {
209
209
HashMap <String , KeyStrategy > keyStrategyHashMap = new HashMap <>();
210
- if (llmInputMessagesKey != null ){
210
+ if (llmInputMessagesKey != null ) {
211
211
keyStrategyHashMap .put (llmInputMessagesKey , new ReplaceStrategy ());
212
212
}
213
213
keyStrategyHashMap .put ("messages" , new AppendStrategy ());
214
214
return keyStrategyHashMap ;
215
215
};
216
- } else {
216
+ }
217
+ else {
217
218
KeyStrategyFactory originalFactory = this .keyStrategyFactory ;
218
219
this .keyStrategyFactory = () -> {
219
220
HashMap <String , KeyStrategy > keyStrategyHashMap = new HashMap <>(originalFactory .apply ());
220
221
keyStrategyHashMap .put ("messages" , new AppendStrategy ());
221
222
return keyStrategyHashMap ;
222
223
};
223
224
}
224
-
225
+
225
226
StateGraph graph = new StateGraph (name , this .keyStrategyFactory );
226
227
227
228
if (preLlmHook != null ) {
You can’t perform that action at this time.
0 commit comments