Repository navigation
Doc built in actions - #669
Conversation
|
hi @wenjin272 ,I'm not sure if this description meets your expectations. PTAL |
weiqingy
left a comment
There was a problem hiding this comment.
Thanks for the doc — the descriptions track the code behavior accurately. A few small wording nits inline; nothing structural.
|
|
||
| ## 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`. |
There was a problem hiding this 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.
|
|
||
| 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. |
There was a problem hiding this 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?
|
|
||
| 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 |
There was a problem hiding this 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.
# Conflicts: # docs/content/docs/development/vector_stores.md
@weiqingy Thanks for your review. I fixed the grammar mistakes above and put the citation on one line. PTAL |
weiqingy
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround — the wording reads cleanly now. LGTM.
Linked issue: #653
Purpose of change
Add explanations for built-in actions
Tests
dot need test
API
no api
Documentation
doc-neededdoc-not-neededdoc-included