diff --git a/java/src/main/java/com/genexus/GXProcedure.java b/java/src/main/java/com/genexus/GXProcedure.java index 008cd1d45..0f597bbc5 100644 --- a/java/src/main/java/com/genexus/GXProcedure.java +++ b/java/src/main/java/com/genexus/GXProcedure.java @@ -275,6 +275,10 @@ protected String callAssistant(String agent, GXProperties properties, ArrayList< } protected ChatResult chatAgent(String agent, GXProperties properties, ArrayList messages, CallResult result) { + return chatAgent(agent, properties, messages, null, result); + } + + protected ChatResult chatAgent(String agent, GXProperties properties, ArrayList messages, GXExternalCollection history, CallResult result) { ChatResult chatResult = new ChatResult(); new Thread(() -> { @@ -283,6 +287,8 @@ protected ChatResult chatAgent(String agent, GXProperties properties, ArrayList< callAgent(agent, true, properties, messages, result, chatResult); } finally { chatResult.markDone(); + if (history != null) + history.setExternalInstance(messages); } }).start();