Constructor SkillResourceTool
SkillResourceTool(SkillRegistry, string, int)
Initializes a new instance of the SkillResourceTool class.
public SkillResourceTool(SkillRegistry registry, string name = "load_skill_resource", int maxContentLength = 65536)
Parameters
registrySkillRegistryThe skill registry to access resources from.
namestringThe tool name. Defaults to DefaultName (
load_skill_resource).maxContentLengthintMaximum content length to return. Defaults to DefaultMaxContentLength (64KB). Larger files will be truncated with a warning.
Examples
Creating and registering a SkillResourceTool:
var registry = new SkillRegistry();
registry.LoadFromDirectory("./skills");
// Default configuration
var resourceTool = new SkillResourceTool(registry);
// Custom max content length (128KB)
var largerTool = new SkillResourceTool(registry, maxContentLength: 131072);
conversation.Tools.Register(resourceTool);
Exceptions
- ArgumentNullException
Thrown when
registryisnull.