{"record":{"id":"269df59b9dc312a7","repo":"zylon-ai/private-gpt","slug":"only-one-ingested-context-is-supported-269df5","errorCode":null,"errorMessage":"Only one ingested context is supported.","messagePattern":"Only one ingested context is supported\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/tools/processors/tabular_data_processor.py","lineNumber":51,"sourceCode":"    async def intercept(self, request: ResolvedChatRequest) -> bool:\n        for tool in request.tool_config.tools:\n            if not _tool_matches(\n                tool, TABULAR_DATA_ANALYSIS\n            ) or not _is_unresolved_tool(tool):\n                continue\n\n            tool_context = _get_tool_context(request, tool)\n            ingested_artifacts = (\n                [a for a in tool_context if isinstance(a, IngestedArtifact)]\n                if tool_context\n                else None\n            )\n            if not ingested_artifacts:\n                raise ValueError(\n                    \"Tabular data analysis tool requires an ingested artifact context.\",\n                )\n            if len(ingested_artifacts) > 1:\n                raise ValueError(\"Only one ingested context is supported.\")\n\n            try:\n                resolved = await self._builder.build_tool(\n                    model_id=request.system.model,\n                    name=tool.name or TABULAR_DATA_ANALYSIS,\n                    type=tool.type or TABULAR_DATA_ANALYSIS + \"_v1\",\n                    context_filter=ingested_artifacts[0].context_filter,\n                    validate=request.tool_config.validation_mode,\n                    blob_visibility=request.system.blob_visibility,\n                )\n            except ImportError as e:\n                logger.warning(\"Tabular tool unavailable: %s\", e)\n                raise RuntimeError(_PANDASAI_NOT_INSTALLED_MSG) from e\n\n            return _replace_tool(request, tool, [resolved])\n        return False\n","sourceCodeStart":33,"sourceCodeEnd":68,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/tools/processors/tabular_data_processor.py#L33-L68","documentation":"Raised by the TabularDataProcessor when the tabular data analysis tool's context contains more than one IngestedArtifact. The builder accepts a single context_filter, so multiple ingested corpora on one tool are rejected.","triggerScenarios":"Attaching two or more IngestedArtifact entries to a single TABULAR_DATA_ANALYSIS tool entry.","commonSituations":"Multi-selecting datasets in a client UI; aggregating several ingested collections into one tool call; retry logic appending a duplicate artifact.","solutions":["Limit the tool context to one IngestedArtifact","Run one tabular tool per corpus (separate tool entries or requests)","Ingest the datasets into a single collection and use that one context_filter"],"exampleFix":"# before\ncontext=[IngestedArtifact(cf_sales), IngestedArtifact(cf_hr)]\n# after\ncontext=[IngestedArtifact(cf_sales)]  # second corpus via its own tool entry","handlingStrategy":"validation","validationCode":"ingested = [a for a in (tool_context or []) if isinstance(a, IngestedArtifact)]\nassert len(ingested) <= 1, \"tabular tool supports exactly one IngestedArtifact\"","typeGuard":null,"tryCatchPattern":"try:\n    resp = await client.chat(request)\nexcept ValueError as e:\n    if \"Only one ingested context\" in str(e):\n        # one tool entry per dataset, then resend\n        raise","preventionTips":["Single-select datasets for the tabular tool in UIs","Dedupe artifacts by context_filter before attaching","Split multi-dataset analyses into parallel single-dataset requests"],"tags":["tools","validation","tabular-data"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}