Skip to content

Commit 806a08e

Browse files
authored
docs(tool): fix the Bash dangerous-path constructor example (#71)
2 parents 582feb0 + 04b0eb4 commit 806a08e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎en/versions/2.0.9dev/building-blocks/tool/python-tool.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ The `Bash` tool executes shell commands and returns stdout/stderr. It implements
108108

109109
`generate_suggestions()` extracts the command prefix (first two tokens) and proposes a prefix rule. For example, `git commit -m "fix bug"` produces the suggestion `git commit:*`.
110110

111-
The constructor accepts optional extra entries for the dangerous-path lists:
111+
The constructor accepts custom dangerous-path lists. A list you pass replaces the corresponding default list instead of extending it, and an empty list disables that check:
112112

113113
```python
114114
from agentscope.tool import Bash
115115

116116
bash = Bash(
117-
additional_dangerous_files=[".secrets"],
118-
additional_dangerous_directories=[".credentials"],
117+
dangerous_files=[".env", ".secrets"],
118+
dangerous_directories=[".ssh", ".credentials"],
119119
)
120120
```
121121

‎zh/versions/2.0.9dev/building-blocks/tool/python-tool.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ grep = Grep(cwd="./project")
108108

109109
`generate_suggestions()` 抽取命令前缀(前两个 token)并给出前缀规则。例如 `git commit -m "fix bug"` 生成建议 `git commit:*`。
110110

111-
构造函数支持向危险路径列表追加自定义条目:
111+
构造函数支持传入自定义的危险路径列表。传入的列表会替换对应的默认列表,而不是在默认列表上追加;传入空列表则关闭该项检查:
112112

113113
```python
114114
from agentscope.tool import Bash
115115

116116
bash = Bash(
117-
additional_dangerous_files=[".secrets"],
118-
additional_dangerous_directories=[".credentials"],
117+
dangerous_files=[".env", ".secrets"],
118+
dangerous_directories=[".ssh", ".credentials"],
119119
)
120120
```
121121

0 commit comments

Comments
 (0)