You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/patterns/tool-transformation.mdx
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ To modify an argument, you need to create an `ArgTransform` object. This object
93
93
-`type`: The new type for the argument.
94
94
95
95
<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.
97
97
</Tip>
98
98
99
99
@@ -182,7 +182,11 @@ Default values are especially useful in combination with hidden arguments.
182
182
183
183
### Hiding Arguments
184
184
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>`.
0 commit comments