iflytek/astron-agent · error · ProtocolParamException

fileUrl is required

Error message

fileUrl is required

What it means

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.

Solutions

  1. Pass a valid fileUrl (a URL accessible by the AIUI service) to split()
  2. Upload the document first to object storage and use the resulting URL as fileUrl
  3. If you only have a local file, switch to a strategy that accepts file uploads (e.g. CBG strategy with file=)
  4. Check the calling code path that extracts fileUrl from the request — it may be defaulting to None

Example fix

// before
await strategy.split(query=..., top_k=...)  # fileUrl missing
// after
await strategy.split(fileUrl="https://oss.example.com/doc.pdf", ...)
Defensive patterns

Strategy: validation

Validate before calling

if not fileUrl or not str(fileUrl).startswith(("http://", "https://")):
    raise ValueError("fileUrl must be a non-empty http(s) URL before calling split")

Type guard

def has_file_url(kwargs: dict) -> bool:
    url = kwargs.get("fileUrl")
    return isinstance(url, str) and url.startswith(("http://", "https://"))

Try / catch

try:
    chunks = await strategy.split(fileUrl=url)
except ProtocolParamException as e:
    logger.warning(f"Missing parameter: {e.msg}")
    return []

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/d7295ea32281d938. Report an issue: GitHub.

Appendix: source

Thrown at core/knowledge/service/impl/aiui_strategy.py:110

    ) -> List[Dict[str, Any]]:
        """
        Split file into multiple chunks

        Args:
            fileUrl: File url
            lengthRange: Length range
            overlap: Overlap length
            resourceType: Resource type
            separator: Separator list
            titleSplit: Whether to split by title
            cutOff: Cutoff marker list
            **kwargs: Other parameters

        Returns:
            List of split chunks
        """
        if fileUrl is None:
            raise ProtocolParamException(msg="fileUrl is required")

        # Set default values
        lengthRange = lengthRange or [16, 512]
        overlap = overlap or 16
        separator = separator or ["。", "!", ";", "?"]
        titleSplit = True  # Force set to True

        # Document parsing
        doc_parse_response_data = await aiui.document_parse(
            fileUrl, resourceType, **kwargs
        )

        # Split chunks
        doc_split_response_data = await aiui.chunk_split(
            lengthRange=lengthRange,
            document=doc_parse_response_data,
            overlap=overlap,
            cutOff=cutOff,

View on GitHub (pinned to 5e758547a8)