This is an automated email from the ASF dual-hosted git repository.
xintongsong pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-agents.git
The following commit(s) were added to refs/heads/main by this push:
new 918f812a [doc] Add docs for built-in actions (#669)
918f812a is described below
commit 918f812a51e771c0be82921ed822e88d4ca62137
Author: daken <[email protected]>
AuthorDate: Fri May 29 00:05:59 2026 +0800
[doc] Add docs for built-in actions (#669)
---
docs/content/docs/development/chat_models.md | 5 +++++
docs/content/docs/development/tool_use.md | 8 ++++++++
docs/content/docs/development/vector_stores.md | 4 ++++
docs/content/docs/development/workflow_agent.md | 5 +++--
4 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/docs/content/docs/development/chat_models.md
b/docs/content/docs/development/chat_models.md
index 15b330ae..f6bfe7b7 100644
--- a/docs/content/docs/development/chat_models.md
+++ b/docs/content/docs/development/chat_models.md
@@ -1366,3 +1366,8 @@ 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 sends a `ChatResponseEvent`.
+
+If the model asks to call tools, `chat_model_action` sends 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, see
[Built-in Events and Actions in Tool Use]({{< ref
"docs/development/tool_use#built-in-events-and-actions" >}}).
\ No newline at end of file
diff --git a/docs/content/docs/development/tool_use.md
b/docs/content/docs/development/tool_use.md
index 895ef2db..fabb5048 100644
--- a/docs/content/docs/development/tool_use.md
+++ b/docs/content/docs/development/tool_use.md
@@ -182,3 +182,11 @@ 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`.
+
+When the tool request comes from `chat_model_action`, the emitted
`ToolResponseEvent` is automatically consumed by `chat_model_action` to
continue the chat. See [Built-in Events and Actions in Chat Models]({{< ref
"docs/development/chat_models#built-in-events-and-actions" >}}) for details on
how `chat_model_action` handles tool responses.
+
+Users can also send `ToolRequestEvent` directly when they want to invoke tools
programmatically.
\ No newline at end of file
diff --git a/docs/content/docs/development/vector_stores.md
b/docs/content/docs/development/vector_stores.md
index e8582649..5184e82d 100644
--- a/docs/content/docs/development/vector_stores.md
+++ b/docs/content/docs/development/vector_stores.md
@@ -1377,3 +1377,7 @@ public class MyVectorStore extends BaseVectorStore
{{< /tab >}}
{{< /tabs >}}
+
+## Built-in Events and Actions
+
+The built-in `context_retrieval_action` listens to
`ContextRetrievalRequestEvent`. To retrieve relevant documents, send a
`ContextRetrievalRequestEvent`. The action queries the configured vector store
through durable execution and sends a `ContextRetrievalResponseEvent`.
\ No newline at end of file
diff --git a/docs/content/docs/development/workflow_agent.md
b/docs/content/docs/development/workflow_agent.md
index f122727f..11ef5050 100644
--- a/docs/content/docs/development/workflow_agent.md
+++ b/docs/content/docs/development/workflow_agent.md
@@ -609,5 +609,6 @@ All attribute values must be JSON-serializable. In Python,
this means `BaseModel
## Built-in Events and Actions
There are several built-in `Event` and `Action` in Flink-Agents:
-* See [Chat Models]({{< ref "docs/development/chat_models" >}}) for how to
chat with a LLM leveraging built-in action and events.
-* See [Tool Use]({{< ref "docs/development/tool_use" >}}) for how to
programmatically use a tool leveraging built-in action and events.
+* See [Chat Models]({{< ref
"docs/development/chat_models#built-in-events-and-actions" >}}) for how to chat
with a LLM leveraging built-in action and events.
+* See [Tool Use]({{< ref
"docs/development/tool_use#built-in-events-and-actions" >}}) for how to
programmatically use a tool leveraging built-in action and events.
+* See [Vector Stores]({{< ref
"docs/development/vector_stores#built-in-events-and-actions" >}}) for how to
retrieve context from vector stores leveraging built-in action and events.
\ No newline at end of file