{"record":{"id":"330c17062dfa70ab","repo":"BerriAI/litellm","slug":"invalid-ragflow-endpoint-type-endpoint-type-mu","errorCode":null,"errorMessage":"Invalid RAGFlow endpoint type: {endpoint_type}. Must be 'chat' or 'agent'","messagePattern":"Invalid RAGFlow endpoint type: (.+?)\\. Must be 'chat' or 'agent'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/ragflow/chat/transformation.py","lineNumber":56,"sourceCode":"        Returns:\n            Tuple of (endpoint_type, id, model_name)\n\n        Raises:\n            ValueError: If model format is invalid\n        \"\"\"\n        parts: Final = model.split(\"/\")\n        if len(parts) < 4:\n            raise ValueError(\n                f\"Invalid RAGFlow model format: {model}. \"\n                f\"Expected format: ragflow/chat/{{chat_id}}/{{model}} or ragflow/agent/{{agent_id}}/{{model}}\"\n            )\n\n        if parts[0] != \"ragflow\":\n            raise ValueError(f\"Invalid RAGFlow model format: {model}. Must start with 'ragflow/'\")\n\n        endpoint_type: Final = parts[1]\n        if endpoint_type not in [\"chat\", \"agent\"]:\n            raise ValueError(f\"Invalid RAGFlow endpoint type: {endpoint_type}. Must be 'chat' or 'agent'\")\n\n        entity_id: Final = parts[2]\n        model_name: Final = \"/\".join(parts[3:])  # Handle model names that might contain slashes\n\n        return endpoint_type, entity_id, model_name\n\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        api_key: str | None,\n        model: str,\n        optional_params: dict,\n        litellm_params: dict,\n        stream: bool | None = None,\n    ) -> str:\n        \"\"\"\n        Get the complete URL for the RAGFlow API call.\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/ragflow/chat/transformation.py#L38-L74","documentation":"Model-format parser guard in the RAGFlow chat config: the second path segment (endpoint type) is neither 'chat' nor 'agent', so LiteLLM cannot decide whether to target a RAGFlow chat session or an agent endpoint.","triggerScenarios":"Triggered when the RAGFlow endpoint type segment is neither 'chat' nor 'agent'.","commonSituations":"See trigger scenarios.","solutions":["Use 'chat' or 'agent' as the endpoint type segment in the model string.","Check the model string's second segment for typos."],"exampleFix":"model=\"ragflow/chat/<chat_id>/<model>\"  # not ragflow/session/...","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}