weiqingy commented on code in PR #669:
URL: https://github.com/apache/flink-agents/pull/669#discussion_r3299665232
##########
docs/content/docs/development/chat_models.md:
##########
@@ -1216,3 +1216,9 @@ public class MyChatModelSetup extends BaseChatModelSetup {
{{< /tabs >}}
+## Built-in Events and Actions
+
+The built-in `chat_model_action` listens to `ChatRequestEvent` and
`ToolResponseEvent`. To request a chat completion, send a `ChatRequestEvent`.
If the model returns a final answer, the action send a `ChatResponseEvent`.
Review Comment:
Small subject-verb fix: "the action send a `ChatResponseEvent`" → "the
action **sends**". Same issue two lines down on 1223 ("`chat_model_action` send
a `ToolRequestEvent`"), so worth catching both in one sweep.
##########
docs/content/docs/development/chat_models.md:
##########
@@ -1216,3 +1216,9 @@ public class MyChatModelSetup extends BaseChatModelSetup {
{{< /tabs >}}
+## Built-in Events and Actions
+
+The built-in `chat_model_action` listens to `ChatRequestEvent` and
`ToolResponseEvent`. To request a chat completion, send a `ChatRequestEvent`.
If the model returns a final answer, the action send a `ChatResponseEvent`.
+
+If the model asks to call tools, `chat_model_action` send a `ToolRequestEvent`
instead of a final `ChatResponseEvent`. After the tools finish, it receives the
matching `ToolResponseEvent`, appends the tool results to the chat history, and
calls the model again. This loop continues until the model returns a final
response. For details on how tools are executed.
Review Comment:
The trailing "For details on how tools are executed." reads as a fragment
because the cross-link sits on the next line. Could you fold it into a single
sentence — something like "For details on how tools are executed, see [Built-in
Events and Actions in Tool Use](...)" — so the section closes on a complete
clause?
##########
docs/content/docs/development/tool_use.md:
##########
@@ -182,3 +182,9 @@ ReActAgent reviewAnalysisReactAgent = new ReActAgent(
## MCP Tool
See [MCP]({{< ref "docs/development/mcp" >}}) for details.
+
+## Built-in Events and Actions
+
+The built-in `tool_call_action` listens to `ToolRequestEvent`. For each tool
call, it looks up the tool resource by function name, executes it through
durable execution, and records whether it succeeded. After all tool calls in
the batch have been processed, it sends a `ToolResponseEvent`.
Review Comment:
Two readability nits on this line: there's a missing space between "tool
responses." and "Users can also send…", and the topic shift from
"chat_model_action handles tool responses" to "you can also send
`ToolRequestEvent` directly" reads better as a separate sentence on its own
paragraph. Splitting them gives the "you can also invoke tools manually" hook a
clearer landing spot.
--
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]