Skip to content

Commit fc25991

Browse files
committed
Update docs
1 parent 47b2c58 commit fc25991

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/patterns/tool-transformation.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ To modify an argument, you need to create an `ArgTransform` object. This object
9393
- `type`: The new type for the argument.
9494

9595
<Tip>
96-
Certain combinations of parameters are not allowed. For example, you can only use `default_factory` with `hide=True`, because dynamic defaults cannot be represented in a JSON schema for the client. You can only set required=True
96+
Certain combinations of parameters are not allowed. For example, you can only use `default_factory` with `hide=True`, because dynamic defaults cannot be represented in a JSON schema for the client. You can only set required=True for arguments that do not declare a default value.
9797
</Tip>
9898

9999

@@ -182,7 +182,11 @@ Default values are especially useful in combination with hidden arguments.
182182

183183
### Hiding Arguments
184184

185-
Sometimes a tool requires arguments that shouldn't be exposed to the LLM, such as API keys, configuration flags, or internal IDs. You can hide these parameters using `hide=True`. You can only hide arguments that already have a default value, or that you provide a new `default` or `default_factory` for.
185+
Sometimes a tool requires arguments that shouldn't be exposed to the LLM, such as API keys, configuration flags, or internal IDs. You can hide these parameters using `hide=True`. Note that you can only hide arguments that have a default value (or for which you provide a new default), because the LLM can't provide a value at call time.
186+
187+
<Tip>
188+
To pass a constant value to the parent tool, combine `hide=True` with `default=<value>`.
189+
</Tip>
186190

187191
```python {19-20}
188192
import os
@@ -398,7 +402,7 @@ async def ensure_a_positive(a: int, **kwargs) -> int:
398402

399403
new_tool = Tool.from_tool(
400404
add,
401-
transform_fn=ensure_positive,
405+
transform_fn=ensure_a_positive,
402406
transform_args={
403407
"x": ArgTransform(name="a"),
404408
"y": ArgTransform(name="b"),

0 commit comments

Comments
 (0)