Class HttpDownloadTool
Downloads a file from a URL to the local filesystem with streaming and size limits.
public sealed class HttpDownloadTool : IBuiltInTool, ITool, IToolMetadata, IDisposable
- Inheritance
-
HttpDownloadTool
- Implements
- Inherited Members
Examples
Downloading a binary asset to disk via the agent:
using LMKit.Agents;
using LMKit.Agents.Tools.BuiltIn.Net;
var agent = Agent.CreateBuilder(model)
.WithTools(t => t.Register(new HttpDownloadTool()))
.Build();
var result = await agent.RunAsync(
@"Download https://example.com/release.zip to C:\downloads\release.zip.");
Constructors
- HttpDownloadTool()
Initializes a new instance with default settings.
- HttpDownloadTool(HttpToolOptions)
Initializes a new instance with custom options.
- HttpDownloadTool(HttpClient, HttpToolOptions)
Initializes a new instance with an existing HttpClient.
Properties
- Description
Gets a concise description of what the tool does.
- InputSchema
Gets the JSON Schema defining the expected input arguments.
- MaxDownloadSize
Gets or sets the maximum download size in bytes. 0 for unlimited. Default is 100 MB.
- Name
Gets the stable, unique identifier for this tool.
Methods
- InvokeAsync(string, CancellationToken)
Executes the tool with the specified JSON arguments.