Skip to content

Commit b3da32d

Browse files
committed
text -> result
1 parent a8a4b60 commit b3da32d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

experimental/ai/impl/src/main/java/io/serverlessworkflow/impl/executors/ai/CallAIChatModelExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected Map<String, Object> prepareResponse(ChatResponse response, Object java
137137
}
138138

139139
if (aiMessage != null) {
140-
responseMap.put("text", aiMessage.text());
140+
responseMap.put("result", aiMessage.text());
141141
}
142142

143143
return responseMap;

experimental/ai/impl/src/main/java/io/serverlessworkflow/impl/executors/ai/CallAILangChainChatModelExecutor.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,11 @@ public Object apply(CallAILangChainChatModel callAIChatModel, Object javaObject)
4848
}
4949

5050
Object response = method.invoke(aiServices, args);
51-
52-
if (response instanceof String chatResponse) {
53-
substitutions.put("text", chatResponse);
54-
return substitutions;
55-
} else {
56-
throw new IllegalArgumentException(
57-
"Method " + method.getName() + " did not return a ChatResponse");
58-
}
51+
substitutions.put("result", response);
5952
} catch (Exception e) {
6053
throw new RuntimeException("Error invoking chat model method", e);
6154
}
55+
return substitutions;
6256
}
6357

6458
private void validate(

0 commit comments

Comments
 (0)