{"record":{"id":"87b9db30983dbf9f","repo":"zylon-ai/private-gpt","slug":"tabular-data-analysis-tool-requires-an-ingested-ar","errorCode":null,"errorMessage":"Tabular data analysis tool requires an ingested artifact context.","messagePattern":"Tabular data analysis tool requires an ingested artifact context\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/tools/processors/tabular_data_processor.py","lineNumber":47,"sourceCode":"    @inject\n    def __init__(self, tabular_data_tool_builder: TabularDataToolBuilder) -> None:\n        self._builder = tabular_data_tool_builder\n\n    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","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/tools/processors/tabular_data_processor.py#L29-L65","documentation":"Raised by the TabularDataProcessor when the tabular data analysis tool (TABULAR_DATA_ANALYSIS) is present in a request but its tool context holds no IngestedArtifact. The tool is built from an ingested corpus's context_filter, so without one it cannot be resolved.","triggerScenarios":"Enabling the tabular data analysis tool while tool_context is None/empty or only contains non-ingested artifact types.","commonSituations":"Tool catalogs enabling every tool by default; ingesting CSV/spreadsheet data but not passing the corresponding IngestedArtifact; artifact attached to a different tool entry in a multi-tool request.","solutions":["Attach exactly one IngestedArtifact (the ingested tabular corpus) to the tabular tool's context","Or remove the tabular data analysis tool when no ingested data is in scope","Verify the data was ingested successfully and its context_filter is available"],"exampleFix":"# before\ntools=[ToolConfig(name=TABULAR_DATA_ANALYSIS)]\n# after\ntools=[\n    ToolConfig(\n        name=TABULAR_DATA_ANALYSIS,\n        context=[IngestedArtifact(context_filter=ContextFilter(filters=...))],\n    )\n]","handlingStrategy":"validation","validationCode":"ingested = [a for a in (tool_context or []) if isinstance(a, IngestedArtifact)]\nif not ingested:\n    # exclude TABULAR_DATA_ANALYSIS from the request or attach an IngestedArtifact","typeGuard":"def is_ingested_artifact(ctx: object) -> bool:\n    return isinstance(ctx, IngestedArtifact)","tryCatchPattern":"try:\n    resp = await client.chat(request)\nexcept ValueError as e:\n    if \"requires an ingested artifact context\" in str(e):\n        # attach the ingested tabular corpus and resend\n        raise","preventionTips":["Offer the tabular tool only after a dataset has been selected/ingested","Validate tool-to-artifact requirements before submitting multi-tool requests","Check the PandasAI extra is installed wherever the tabular tool is enabled"],"tags":["tools","validation","tabular-data","pandasai"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}