Skip to content

Add BilibiliHotTool for fetching trending Chinese video content #2670

Description

@Tree005

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions