SurfSense/surfsense_backend/app/capabilities/tiktok/trending/definition.py
CREDO23 67b5472b9f feat(tiktok): add tiktok.trending verb for the Explore feed
The Explore feed (/api/explore/item_list) is a global trending-video feed
served to anonymous sessions, and it returns the same itemStruct shape as the
other listings — so the verb reuses parse_video, the listing flow, the
TikTokVideoItem output, and the per-video billing meter wholesale. Adds a
browser-capture marker + fetch_trending, a synthetic-target orchestrator entry,
and the tiktok.trending capability, surfaced on the chat subagent.
2026-07-09 18:52:56 +02:00

23 lines
841 B
Python

"""``tiktok.trending`` capability registration (billed per video on the shared
``TIKTOK_MICROS_PER_VIDEO`` meter)."""
from __future__ import annotations
from app.capabilities.core import BillingUnit, Capability, register_capability
from app.capabilities.tiktok.trending.executor import build_trending_executor
from app.capabilities.tiktok.trending.schemas import TrendingInput, TrendingOutput
TIKTOK_TRENDING = Capability(
name="tiktok.trending",
description=(
"Get the current trending TikTok videos from the Explore feed. No input "
"needed beyond how many to return."
),
input_schema=TrendingInput,
output_schema=TrendingOutput,
executor=build_trending_executor(),
billing_unit=BillingUnit.TIKTOK_VIDEO,
docs_url="/docs/connectors/native/tiktok",
)
register_capability(TIKTOK_TRENDING)