Get variables from tools, where each tool's code is used as the variable value. Args: tool_name (Optional[str]): Name of a specific tool. If None, returns variables for all tools. Returns: Dict[str, Variable]: Dictionary mapping tool name
(self, tool_name: Optional[str] = None)
| 210 | return await self.tool_context_manager.retrieve(query=query, k=k) |
| 211 | |
| 212 | async def get_variables(self, tool_name: Optional[str] = None) -> Dict[str, 'Variable']: |
| 213 | """Get variables from tools, where each tool's code is used as the variable value. |
| 214 | |
| 215 | Args: |
| 216 | tool_name (Optional[str]): Name of a specific tool. If None, returns variables for all tools. |
| 217 | |
| 218 | Returns: |
| 219 | Dict[str, Variable]: Dictionary mapping tool names to Variable objects. |
| 220 | """ |
| 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. |