@sisu-ai/tool-wikipedia
v8.0.0
Published
Wikipedia lookup tool using the REST API. Fetch a page summary, HTML, or related pages given an approximate title. The REST API performs redirects and normalization, so near-matches often resolve.
Maintainers
Readme
@sisu-ai/tool-wikipedia
Wikipedia lookup tool using the REST API. Fetch a page summary, HTML, or related pages given an approximate title. The REST API performs redirects and normalization, so near-matches often resolve.
Install
npm i @sisu-ai/tool-wikipediaEnvironment / Flags
- Language:
WIKIPEDIA_LANGorWIKI_LANG(e.g.,en,sv). CLI flags follow kebab-case, e.g.,--wikipedia-lang=sv. - Base URL override:
WIKIPEDIA_BASE_URLorWIKI_BASE_URL(e.g.,https://en.wikipedia.org/api/rest_v1). CLI flag--wikipedia-base-url=.... - Defaults to
https://en.wikipedia.org/api/rest_v1.
Usage
import { Agent } from '@sisu-ai/core';
import { registerTools } from '@sisu-ai/mw-register-tools';
import { toolCalling } from '@sisu-ai/mw-tool-calling';
import { wikipedia } from '@sisu-ai/tool-wikipedia';
const app = new Agent()
.use(registerTools([wikipedia]))
.use(toolCalling);Tool
- Name:
wikipediaLookup - Args:
title: string— approximate page titleformat?: 'summary'|'html'|'related'— defaultsummarylang?: string— language code; otherwise from env/flags
Returns
summary:{ type?, title, description?, extract?, url?, thumbnailUrl? }html:stringHTMLrelated:Array<{ title, description?, extract?, url?, thumbnailUrl? }>
Notes
- For search-like behavior, consider calling
relatedfirst and then fetching the best candidate'ssummary.
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.
