{"record":{"id":"7b9fa3063eca8e6d","repo":"HKUDS/DeepTutor","slug":"at-least-one-url-is-required","errorCode":null,"errorMessage":"At least one URL is required.","messagePattern":"At least one URL is required\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/capabilities/ima/tools.py","lineNumber":431,"sourceCode":"\n\ndef _no_binding_message(bindings: tuple[ImaBinding, ...]) -> str:\n    if not bindings:\n        return \"No Tencent IMA knowledge base is attached to this turn; IMA tools are unavailable.\"\n    names = \", \".join(binding.name for binding in bindings)\n    return f\"Specify which IMA knowledge base to use with kb_name. Attached: {names}.\"\n\n\ndef _string_list(value: Any) -> list[str]:\n    if isinstance(value, str):\n        candidates = [value]\n    elif isinstance(value, (list, tuple)):\n        candidates = [str(item) for item in value]\n    else:\n        raise ValueError(\"urls must be a list of strings.\")\n    urls = [item.strip() for item in candidates if str(item).strip()]\n    if not urls:\n        raise ValueError(\"At least one URL is required.\")\n    return urls\n\n\n# IMA's API refuses these; failing locally keeps the model from reporting a\n# confusing upstream error for something that was never going to work.\n_UNSUPPORTED_URL_MARKERS: tuple[str, ...] = (\n    \"bilibili.com/video/\",\n    \"youtube.com/watch\",\n    \"youtu.be/\",\n)\n\n\ndef _is_supported_url(url: str) -> bool:\n    lowered = url.lower()\n    if not lowered.startswith((\"http://\", \"https://\")):\n        return False\n    return not any(marker in lowered for marker in _UNSUPPORTED_URL_MARKERS)\n","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/capabilities/ima/tools.py#L413-L449","documentation":"Error \"At least one URL is required.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/capabilities/ima/tools.py:431 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}