Skip to main content

HTTP Tools

Category: http · 5 tools

Make HTTP requests to APIs and download files.

Tools​

ToolParametersDescription
http.geturl, headers?HTTP GET request
http.posturl, body, headers?HTTP POST request
http.puturl, body, headers?HTTP PUT request
http.deleteurl, headers?HTTP DELETE request
http.downloadurl, path, headers?Download file to disk

Examples​

API Requests​

const stream = toolpack.stream({
messages: [{ role: 'user', content: 'Get the current weather from api.weather.com' }],
model: 'gpt-4o',
});
// AI uses http.get

Downloading Files​

const stream = toolpack.stream({
messages: [{ role: 'user', content: 'Download the logo from example.com/logo.png' }],
model: 'gpt-4o',
});
// AI uses http.download

POST Requests​

const stream = toolpack.stream({
messages: [{ role: 'user', content: 'Send a POST request to the webhook with this data' }],
model: 'gpt-4o',
});
// AI uses http.post