BerriAI/litellm · error · ValueError

RAGFlow response missing dataset id

Error message

RAGFlow response missing dataset id

What it means

Response-shape guard when transforming a RAGFlow dataset creation response: the JSON parsed fine and the error code was 0, but the 'data' object carries no dataset id, so the created store cannot be referenced and the transformation fails.

Source

Thrown at litellm/llms/ragflow/vector_stores/transformation.py:192

        """
        try:
            response_json: Final = response.json()

            # Check for RAGFlow error response
            if response_json.get("code") != 0:
                error_message: Final = response_json.get("message", "Unknown error")
                raise self.get_error_class(
                    error_message=error_message,
                    status_code=response.status_code,
                    headers=response.headers,
                )

            data: Final = response_json.get("data", {})

            # Extract dataset ID
            dataset_id: Final = data.get("id")
            if not dataset_id:
                raise ValueError("RAGFlow response missing dataset id")

            # Extract name
            name: Final = data.get("name")

            # Convert create_time from milliseconds to seconds (Unix timestamp)
            create_time_ms: Final = data.get("create_time", 0)
            created_at: Final = int(create_time_ms / 1000) if create_time_ms else None

            # Build VectorStoreCreateResponse
            return VectorStoreCreateResponse(
                id=dataset_id,
                object="vector_store",
                created_at=created_at or 0,
                name=name,
                bytes=0,  # RAGFlow doesn't provide bytes in response
                file_counts=VectorStoreFileCounts(
                    in_progress=0,
                    completed=0,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Check the RAGFlow API response; dataset creation failed or returned an unexpected payload.
  2. Verify RAGFLOW_API_KEY, api_base, and the RAGFlow server version.

Example fix

# log the raw response from RAGFlow to see why no dataset id was returned.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Triggered when the RAGFlow dataset creation response does not contain a dataset id.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/163ef682ae6bdc6a. Report an issue: GitHub.