da-daken commented on code in PR #926:
URL: https://github.com/apache/flink-agents/pull/926#discussion_r3665311413


##########
api/src/main/java/org/apache/flink/agents/api/agents/AgentExecutionOptions.java:
##########
@@ -42,9 +44,43 @@ public class AgentExecutionOptions {
     public static final ConfigOption<Boolean> CHAT_ASYNC =
             new ConfigOption<>("chat.async", Boolean.class, true);
 
+    /** Whether the built-in tool-call action runs each tool via durable async 
execution. */
     public static final ConfigOption<Boolean> TOOL_CALL_ASYNC =
             new ConfigOption<>("tool-call.async", Boolean.class, true);
 
+    /**
+     * Whether multiple tool calls from one {@code ToolRequestEvent} run as 
one parallel durable
+     * batch when {@link #TOOL_CALL_ASYNC} is also enabled (JDK 21+).
+     *
+     * <p>Default is {@code true}. A parallel batch raises the number of 
in-flight external calls;
+     * after failover, tools whose results were not yet persisted may be 
submitted again.
+     * Side-effecting tools should be idempotent or provide a {@code 
reconciler()}. Set to {@code
+     * false} to keep serial async or sync tool execution.
+     */
+    public static final ConfigOption<Boolean> TOOL_CALL_PARALLEL =
+            new ConfigOption<>("tool-call.parallel", Boolean.class, true);
+
+    /**
+     * Size of the dedicated thread pool used for tool-call async and parallel 
batch execution.
+     *
+     * <p>Separate from {@link #NUM_ASYNC_THREADS} so a large tool batch does 
not exhaust the global
+     * async pool.
+     */
+    public static final ConfigOption<Integer> TOOL_CALL_NUM_ASYNC_THREADS =
+            new ConfigOption<>(
+                    "tool-call.num-async-threads",
+                    Integer.class,
+                    Runtime.getRuntime().availableProcessors() * 2);
+
+    /**
+     * Overall timeout for one parallel tool-call batch.
+     *
+     * <p>Non-positive values disable the timeout. When the deadline elapses, 
unfinished slots are
+     * failed; slots that already completed keep their success or failure 
outcome.
+     */
+    public static final ConfigOption<Duration> TOOL_CALL_BATCH_TIMEOUT =
+            new ConfigOption<>("tool-call.batch.timeout", Duration.class, 
Duration.ofMillis(-1));

Review Comment:
   Thanks for the catch. I missed the YAML case and have now updated the 
timeout configuration to use the `Long `type



-- 
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]

Reply via email to