OpenBMB/ChatDev · error · ValueError

Attachment '{path}' is {file_size} bytes; exceeds inline lim

Error message

Attachment '{path}' is {file_size} bytes; exceeds inline limit of {self.MAX_INLINE_FILE_BYTES} bytes

What it means

Error "Attachment '{path}' is {file_size} bytes; exceeds inline limit of {self.MAX_INLINE_FILE_BYTES} bytes" thrown in OpenBMB/ChatDev.

Source

Thrown at runtime/node/agent/providers/openai_provider.py:778

        if isinstance(payload, dict):
            return payload.get(key)
        return None

    def _maybe_to_dict(self, payload: Any) -> Dict[str, Any]:
        if hasattr(payload, "model_dump"):
            try:
                return payload.model_dump()
            except Exception:
                return {}
        if isinstance(payload, dict):
            return payload
        return {}

    def _make_data_uri_from_path(self, path: str, mime_type: Optional[str]) -> str:
        mime = mime_type or "application/octet-stream"
        file_size = os.path.getsize(path)
        if file_size > self.MAX_INLINE_FILE_BYTES:
            raise ValueError(
                f"Attachment '{path}' is {file_size} bytes; exceeds inline limit of {self.MAX_INLINE_FILE_BYTES} bytes"
            )
        with open(path, "rb") as handle:
            encoded = base64.b64encode(handle.read()).decode("utf-8")
        return f"data:{mime};base64,{encoded}"

    def _serialize_function_call_output_event(
        self,
        event: FunctionCallOutputEvent,
    ) -> Dict[str, Any]:
        payload: Dict[str, Any] = {
            "type": event.type,
            "call_id": event.call_id or event.function_name or "tool_call",
        }
        if event.output_blocks:
            payload["output"] = self._serialize_blocks(event.output_blocks, MessageRole.TOOL)
        else:
            text = event.output_text or ""

View on GitHub (pinned to 4fb2db0ea9)

When it happens

Trigger: Thrown at runtime/node/agent/providers/openai_provider.py:778 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of OpenBMB/ChatDev@4fb2db0ea9 (2026-08-27). Data as JSON: /api/errors/6199070d21aa17a1. Report an issue: GitHub.