Get trainable variables from tools, filtering out tools with require_grad=False. Args: tool_name (Optional[str]): Name of a specific tool. If None, returns trainable variables for all tools. Returns: Dict[str, Variable]: Dictionary mappin
(self, tool_name: Optional[str] = None)
| 221 | return await self.tool_context_manager.get_variables(tool_name=tool_name) |
| 222 | |
| 223 | async def get_trainable_variables(self, tool_name: Optional[str] = None) -> Dict[str, 'Variable']: |
| 224 | """Get trainable variables from tools, filtering out tools with require_grad=False. |
| 225 | |
| 226 | Args: |
| 227 | tool_name (Optional[str]): Name of a specific tool. If None, returns trainable variables for all tools. |
| 228 | |
| 229 | Returns: |
| 230 | Dict[str, Variable]: Dictionary mapping tool names to Variable objects for tools with require_grad=True. |
| 231 | """ |
| 232 | return await self.tool_context_manager.get_trainable_variables(tool_name=tool_name) |
| 233 | |
| 234 | async def set_variables(self, tool_name: str, variable_updates: Dict[str, Any], new_version: Optional[str] = None, description: Optional[str] = None) -> ToolConfig: |
| 235 | """Set variable values in a tool and create a new version. |