Summary
I'd like to add a small BilibiliHotTool (~130 LOC) that wraps Bilibili's
public /x/web-interface/popular API, so smolagents Agents can fetch
trending Chinese videos without writing one-off HTTP calls.
Motivation
smolagents' built-in web tools (WebSearchTool, VisitWebpageTool,
WikipediaSearchTool) are all English-centric. As a Chinese content creator
using smolagents for trend research, I keep having to write raw requests.get
calls to the Bilibili API.
The popular endpoint requires no authentication, returns ~20 trending
videos per call (title, UP master, view / danmaku / like counts), and fits
the same role as WikipediaSearchTool does for English Wikipedia.
Implementation plan
- Inherits from
Tool, follows the style of WikipediaSearchTool
- Single input:
limit (1–50, default 10, clamped to bounds)
- Markdown-formatted output; rate-limited (1 qps default, configurable)
- Network errors returned as descriptive strings (no raise) so the Agent
can recover
- 8 unit tests + 1 end-to-end example
- No new dependencies (
requests already a transitive dep)
Status
I have a working implementation in my fork:
https://github.com/Tree005/smolagents/tree/feat/bilibili-hot-tool
Happy to open a PR once maintainers confirm the direction, or to adjust
naming, output format, or error messages per maintainer preference.
Summary
I'd like to add a small
BilibiliHotTool(~130 LOC) that wraps Bilibili'spublic
/x/web-interface/popularAPI, so smolagents Agents can fetchtrending Chinese videos without writing one-off HTTP calls.
Motivation
smolagents' built-in web tools (
WebSearchTool,VisitWebpageTool,WikipediaSearchTool) are all English-centric. As a Chinese content creatorusing smolagents for trend research, I keep having to write raw
requests.getcalls to the Bilibili API.
The
popularendpoint requires no authentication, returns ~20 trendingvideos per call (title, UP master, view / danmaku / like counts), and fits
the same role as
WikipediaSearchTooldoes for English Wikipedia.Implementation plan
Tool, follows the style ofWikipediaSearchToollimit(1–50, default 10, clamped to bounds)can recover
requestsalready a transitive dep)Status
I have a working implementation in my fork:
https://github.com/Tree005/smolagents/tree/feat/bilibili-hot-tool
Happy to open a PR once maintainers confirm the direction, or to adjust
naming, output format, or error messages per maintainer preference.