ToolManager constructor
Creates a tool manager with the given tools.
Implementation
ToolManager({List<Tool> tools = const []}) : _tools = {} {
for (final tool in tools) {
final description = tool.getToolDescription();
final function = description['function'];
if (function is! Map || function['name'] is! String) {
throw const LiteRtLmException(
'Tool description must contain ["function"]["name"].',
);
}
_tools[function['name'] as String] = tool;
}
}