{"record":{"id":"d7295ea32281d938","repo":"iflytek/astron-agent","slug":"fileurl-is-required","errorCode":null,"errorMessage":"fileUrl is required","messagePattern":"fileUrl is required","errorType":"validation","errorClass":"ProtocolParamException","httpStatus":null,"severity":"error","filePath":"core/knowledge/service/impl/aiui_strategy.py","lineNumber":110,"sourceCode":"    ) -> List[Dict[str, Any]]:\n        \"\"\"\n        Split file into multiple chunks\n\n        Args:\n            fileUrl: File url\n            lengthRange: Length range\n            overlap: Overlap length\n            resourceType: Resource type\n            separator: Separator list\n            titleSplit: Whether to split by title\n            cutOff: Cutoff marker list\n            **kwargs: Other parameters\n\n        Returns:\n            List of split chunks\n        \"\"\"\n        if fileUrl is None:\n            raise ProtocolParamException(msg=\"fileUrl is required\")\n\n        # Set default values\n        lengthRange = lengthRange or [16, 512]\n        overlap = overlap or 16\n        separator = separator or [\"。\", \"！\", \"；\", \"？\"]\n        titleSplit = True  # Force set to True\n\n        # Document parsing\n        doc_parse_response_data = await aiui.document_parse(\n            fileUrl, resourceType, **kwargs\n        )\n\n        # Split chunks\n        doc_split_response_data = await aiui.chunk_split(\n            lengthRange=lengthRange,\n            document=doc_parse_response_data,\n            overlap=overlap,\n            cutOff=cutOff,","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/knowledge/service/impl/aiui_strategy.py#L92-L128","documentation":"AiuiStrategy.split raises ProtocolParamException('fileUrl is required') when the fileUrl parameter is None. The AIUI splitting strategy is URL-based: it must be given the address of the document to split and cannot work from a local file.","triggerScenarios":"Calling split() on the AIUI strategy without passing fileUrl — e.g. passing a local file path or file object instead of a URL, or omitting fileUrl in kwargs.","commonSituations":"Callers built for the CBG strategy (which accepts 'file') reused with the AIUI strategy; document upload step skipped so no URL was produced; None defaulted when extracting fileUrl from a payload.","solutions":["Pass a valid fileUrl (a URL accessible by the AIUI service) to split()","Upload the document first to object storage and use the resulting URL as fileUrl","If you only have a local file, switch to a strategy that accepts file uploads (e.g. CBG strategy with file=)","Check the calling code path that extracts fileUrl from the request — it may be defaulting to None"],"exampleFix":"// before\nawait strategy.split(query=..., top_k=...)  # fileUrl missing\n// after\nawait strategy.split(fileUrl=\"https://oss.example.com/doc.pdf\", ...)","handlingStrategy":"validation","validationCode":"if not fileUrl or not str(fileUrl).startswith((\"http://\", \"https://\")):\n    raise ValueError(\"fileUrl must be a non-empty http(s) URL before calling split\")","typeGuard":"def has_file_url(kwargs: dict) -> bool:\n    url = kwargs.get(\"fileUrl\")\n    return isinstance(url, str) and url.startswith((\"http://\", \"https://\"))","tryCatchPattern":"try:\n    chunks = await strategy.split(fileUrl=url)\nexcept ProtocolParamException as e:\n    logger.warning(f\"Missing parameter: {e.msg}\")\n    return []","preventionTips":["Upload documents to storage and derive fileUrl before strategy dispatch","Standardize the split() parameter contract across strategies","Validate required params at the API layer before reaching the strategy","Add tests covering each strategy's required-parameter errors"],"tags":["validation","parameter","rag"],"backgroundTag":"missing-required-argument","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}