fix(docs): clarify AgentHooks description in Chinese translation - #4301
fix(docs): clarify AgentHooks description in Chinese translation#4301scrazyakai wants to merge 1 commit into
Conversation
|
Thanks for the feedback! It's auto translated, so could you suggest the best way to map English and Chinese terms? https://github.com/openai/openai-agents-python/blob/main/docs/scripts/translate_docs.py |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5967b1dfd7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - `on_handoff`:控制权从一个智能体转移到另一个智能体时。 | ||
|
|
||
| 如果你希望使用单个观察器监控整个工作流,请使用`RunHooks`;如果某个智能体需要自定义副作用,请使用`AgentHooks`。 | ||
| 如果你希望使用单个观察器监控整个工作流,请使用`RunHooks`;如果某个智能体需要自定义`Hooks`,请使用`AgentHooks`。 |
There was a problem hiding this comment.
Apply this clarification through the translation source
When the translation job next regenerates this page, docs/scripts/translate_docs.py::translate_file will rewrite docs/zh/agents.md from the unchanged English source, so this correction will disappear. Update the English source or translation controls and regenerate the localized pages instead of editing the generated Chinese artifact directly.
AGENTS.md reference: AGENTS.md:L110-L110
Useful? React with 👍 / 👎.
| - `on_handoff`:控制权从一个智能体转移到另一个智能体时。 | ||
|
|
||
| 如果你希望使用单个观察器监控整个工作流,请使用`RunHooks`;如果某个智能体需要自定义副作用,请使用`AgentHooks`。 | ||
| 如果你希望使用单个观察器监控整个工作流,请使用`RunHooks`;如果某个智能体需要自定义`Hooks`,请使用`AgentHooks`。 |
There was a problem hiding this comment.
Preserve the AgentHooks behavior distinction
For Chinese readers, formatting Hooks as an identifier introduces a nonexistent generic API name and turns the guidance into the tautology “use AgentHooks when an agent needs custom Hooks,” so it no longer explains when to choose this scope over RunHooks. src/agents/__init__.py exports RunHooks and AgentHooks, not Hooks, and the surrounding section consistently translates the concept as “钩子”; retain a description of agent-specific lifecycle callbacks or side effects instead.
Useful? React with 👍 / 👎.
"自定义副作用"can be misleading, while"自定义Hooks"is easier to understand.