HKUDS/nanobot · error · ValueError

authLevel must be 0 or 1

Error message

authLevel must be 0 or 1

What it means

Error "authLevel must be 0 or 1" thrown in HKUDS/nanobot.

Source

Thrown at nanobot/agent/tools/web.py:336

        return None
    time_range = str(value).strip()
    if not time_range:
        return None
    if time_range in _VOLCENGINE_TIME_RANGES or _VOLCENGINE_DATE_RANGE_RE.fullmatch(time_range):
        return time_range
    raise ValueError(
        "timeRange must be OneDay, OneWeek, OneMonth, OneYear, "
        "or YYYY-MM-DD..YYYY-MM-DD"
    )


def _normalize_volcengine_auth_level(value: Any) -> int | None:
    if value is None:
        return None
    try:
        auth_level = int(value)
    except (TypeError, ValueError) as exc:
        raise ValueError("authLevel must be 0 or 1") from exc
    if auth_level not in {0, 1}:
        raise ValueError("authLevel must be 0 or 1")
    return auth_level


@tool_parameters(
    tool_parameters_schema(
        query=StringSchema("Search query"),
        count=IntegerSchema(description="Results (1-10)", minimum=1, maximum=10),
        timeRange=StringSchema(
            "Optional time filter for providers that support it: "
            "OneDay, OneWeek, OneMonth, OneYear, or YYYY-MM-DD..YYYY-MM-DD",
        ),
        authLevel=IntegerSchema(
            description="Optional authority filter for providers that support it: 0=all, 1=authoritative",
            minimum=0,
            maximum=1,
        ),

View on GitHub (pinned to 42f37dc4c0)

When it happens

Trigger: Thrown at nanobot/agent/tools/web.py:336 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26). Data as JSON: /api/errors/6352584b48269197. Report an issue: GitHub.