@sisu-ai/tool-extract-urls
v9.0.1
Published
Extract unique `http`/`https` URLs from text snippets. Small, deterministic, and zero I/O — great as a first pass before fetching, classifying, or summarizing pages.
Downloads
106
Maintainers
Readme
@sisu-ai/tool-extract-urls
Extract unique http/https URLs from text snippets. Small, deterministic, and zero I/O — great as a first pass before fetching, classifying, or summarizing pages.
Install
npm i @sisu-ai/tool-extract-urlsWhy it’s useful
- Simple guardrail: avoids asking the model to spot links.
- Deterministic: same inputs → same outputs.
- Lightweight: no network calls, safe to run early in a pipeline.
Usage
import { Agent, SimpleTools } from '@sisu-ai/core';
import { registerTools } from '@sisu-ai/mw-register-tools';
import { toolCalling } from '@sisu-ai/mw-tool-calling';
import { extractUrlsTool } from '@sisu-ai/tool-extract-urls';
const app = new Agent()
.use(registerTools([extractUrlsTool]))
.use(toolCalling);
// Prompt example: "Find links in: https://example.com and http://sisu.ai"What it returns
- Array of unique URLs, e.g.
["https://example.com", "http://sisu.ai"].
Notes
- The regex targets
http/httpsURLs and ignores surrounding punctuation where possible. - Prefer pairing with a fetch tool (e.g.,
@sisu-ai/tool-web-fetch) for subsequent content analysis.
Community & Support
Discover what you can do through examples or documentation. Check it out at https://github.com/finger-gun/sisu. Example projects live under examples/ in the repo.
