You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "wenjin272 (via GitHub)" <gi...@apache.org> on 2026/01/16 14:04:07 UTC
[PR] [plan][java] Built-in actions support async execution. [flink-agents]
wenjin272 opened a new pull request, #446:
URL: https://github.com/apache/flink-agents/pull/446
<!--
* Thank you very much for contributing to Flink Agents.
* Please add the relevant components in the PR title. E.g., [api], [runtime], [java], [python], [hotfix], etc.
-->
<!-- Please link the PR to the relevant issue(s). Hotfix doesn't need this. -->
Linked issue: #381
### Purpose of change
Support async execution for java built-in actions
### Tests
e2e
### API
<!-- Does this change touches any public APIs? -->
### Documentation
<!-- Do not remove this section. Check the proper box only. -->
- [ ] `doc-needed` <!-- Your PR changes impact docs -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-included` <!-- Your PR already contains the necessary documentation updates -->
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [plan][java] Built-in actions support async execution. [flink-agents]
Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong merged PR #446:
URL: https://github.com/apache/flink-agents/pull/446
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [plan][java] Built-in actions support async execution. [flink-agents]
Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 commented on PR #446:
URL: https://github.com/apache/flink-agents/pull/446#issuecomment-3760360579
[hs_err_pid84909.log](https://github.com/user-attachments/files/24674348/hs_err_pid84909.log)
Async execution for `PythonChatModelSetup` will cause jvm crash, so the async execution for cross language resources is disable.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [plan][java] Built-in actions support async execution. [flink-agents]
Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong commented on code in PR #446:
URL: https://github.com/apache/flink-agents/pull/446#discussion_r2700544389
##########
plan/src/main/java/org/apache/flink/agents/plan/actions/ChatModelAction.java:
##########
@@ -198,6 +199,8 @@ public static void chat(
(BaseChatModelSetup) ctx.getResource(model, ResourceType.CHAT_MODEL);
boolean chatAsync = ctx.getConfig().get(AgentExecutionOptions.CHAT_ASYNC);
+ // TODO: python chat model doesn't support async execution yet.
+ chatAsync = chatAsync && !(chatModel instanceof PythonChatModelSetup);
Review Comment:
It would be better to point to an issue that describes and tracks the problem blocking python chat model from supporting async execution.
##########
plan/src/main/java/org/apache/flink/agents/plan/actions/ChatModelAction.java:
##########
@@ -210,7 +213,28 @@ public static void chat(
for (int attempt = 0; attempt < numRetries + 1; attempt++) {
try {
- response = chatModel.chat(messages, Map.of());
+ if (chatAsync) {
+ response =
+ ctx.durableExecuteAsync(
+ new DurableCallable<>() {
+ @Override
+ public String getId() {
+ return "chat-async";
+ }
+
+ @Override
+ public Class<ChatMessage> getResultClass() {
+ return ChatMessage.class;
+ }
+
+ @Override
+ public ChatMessage call() throws Exception {
+ return chatModel.chat(messages, Map.of());
+ }
+ });
+ } else {
+ response = chatModel.chat(messages, Map.of());
Review Comment:
Shall we also use `durableExecute` for the synchronized model calls? Same for the other resources and in python.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org