{"record":{"id":"d88058cb9bed8597","repo":"BerriAI/litellm","slug":"all-values-in-argilla-transformation-object-must-b","errorCode":null,"errorMessage":"All values in argilla_transformation_object must be a key in SUPPORTED_PAYLOAD_FIELDS, {v} is not a valid key.","messagePattern":"All values in argilla_transformation_object must be a key in SUPPORTED_PAYLOAD_FIELDS, (.+?) is not a valid key\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/integrations/argilla.py","lineNumber":78,"sourceCode":"            if os.getenv(\"ARGILLA_SAMPLING_RATE\") is not None and os.getenv(\"ARGILLA_SAMPLING_RATE\").strip().isdigit()\n            else 1.0\n        )\n\n        self.async_httpx_client = get_async_httpx_client(llm_provider=httpxSpecialProvider.LoggingCallback)\n        _batch_size: Final = os.getenv(\"ARGILLA_BATCH_SIZE\", None) or litellm.argilla_batch_size\n        if _batch_size:\n            self.batch_size = int(_batch_size)\n        asyncio.create_task(self.periodic_flush())\n        self.flush_lock = asyncio.Lock()\n        super().__init__(**kwargs, flush_lock=self.flush_lock)\n\n    def validate_argilla_transformation_object(self, argilla_transformation_object: dict[str, Any]):\n        if not isinstance(argilla_transformation_object, dict):\n            raise Exception(\"'argilla_transformation_object' must be a dictionary, to log your payload to Argilla.\")\n\n        for v in argilla_transformation_object.values():\n            if v not in SUPPORTED_PAYLOAD_FIELDS:\n                raise Exception(\n                    f\"All values in argilla_transformation_object must be a key in SUPPORTED_PAYLOAD_FIELDS, {v} is not a valid key.\"\n                )\n\n    def get_credentials_from_env(\n        self,\n        argilla_api_key: str | None,\n        argilla_dataset_name: str | None,\n        argilla_base_url: str | None,\n    ) -> ArgillaCredentialsObject:\n        _credentials_api_key: Final = argilla_api_key or os.getenv(\"ARGILLA_API_KEY\")\n        if _credentials_api_key is None:\n            raise Exception(\"Invalid Argilla API Key given. _credentials_api_key=None.\")\n\n        _credentials_base_url: Final = argilla_base_url or os.getenv(\"ARGILLA_BASE_URL\") or \"http://localhost:6900/\"\n        if _credentials_base_url is None:\n            raise Exception(\"Invalid Argilla Base URL given. _credentials_base_url=None.\")\n\n        _credentials_dataset_name = argilla_dataset_name or os.getenv(\"ARGILLA_DATASET_NAME\") or \"litellm-completion\"","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/argilla.py#L60-L96","documentation":"Each value in `litellm.argilla_transformation_object` must be a key in SUPPORTED_PAYLOAD_FIELDS, which litellm defines as `[\"messages\", \"response\"]` (litellm/types/integrations/argilla.py:20). These are the only parts of the standard logging payload the Argilla integration can extract. The validator raises with the offending value so you know exactly which mapping entry is wrong.","triggerScenarios":"Setting a transformation object containing any value other than \"messages\" or \"response\", e.g. `{\"input\": \"prompt\", \"output\": \"completion\"}` — the values \"prompt\" and \"completion\" are not supported and raise at ArgillaLogger init.","commonSituations":"Porting an older litellm example where more payload fields were allowed; guessing field names like \"prompt\", \"model_input\", \"completion\" instead of the canonical keys; mapping the dict backwards (payload key as value instead of as key).","solutions":["Use only \"messages\" and \"response\" as the dict values: `litellm.argilla_transformation_object = {\"prompt\": \"messages\", \"response\": \"response\"}`","If you mapped key/value backwards, swap them so the Argilla field name is the key and the supported payload key is the value","Check the installed version's SUPPORTED_PAYLOAD_FIELDS (`from litellm.types.integrations.argilla import SUPPORTED_PAYLOAD_FIELDS`) if your litellm version differs"],"exampleFix":"# before\nlitellm.argilla_transformation_object = {\n    \"prompt\": \"prompt\",        # \"prompt\" not in [\"messages\", \"response\"]\n    \"response\": \"completion\",  # \"completion\" not in [\"messages\", \"response\"]\n}\n\n# after\nlitellm.argilla_transformation_object = {\n    \"prompt\": \"messages\",\n    \"response\": \"response\",\n}","handlingStrategy":"validation","validationCode":"from litellm.types.integrations.argilla import SUPPORTED_PAYLOAD_FIELDS\n\nmapping = {\"prompt\": \"messages\", \"response\": \"response\"}\nassert all(v in SUPPORTED_PAYLOAD_FIELDS for v in mapping.values()), (\n    f\"bad values: {[v for v in mapping.values() if v not in SUPPORTED_PAYLOAD_FIELDS]}\"\n)\nlitellm.argilla_transformation_object = mapping","typeGuard":"from litellm.types.integrations.argilla import SUPPORTED_PAYLOAD_FIELDS\n\ndef uses_supported_fields(mapping: dict) -> bool:\n    return all(v in SUPPORTED_PAYLOAD_FIELDS for v in mapping.values())","tryCatchPattern":"try:\n    ArgillaLogger()\nexcept Exception as e:\n    if \"SUPPORTED_PAYLOAD_FIELDS\" in str(e):\n        # keep only valid entries, warn about dropped ones\n        valid = {k: v for k, v in mapping.items() if v in SUPPORTED_PAYLOAD_FIELDS}\n        log.warning(\"dropping invalid argilla mappings: %s\", set(mapping) - set(valid))\n        litellm.argilla_transformation_object = valid\n    else:\n        raise","preventionTips":["Pin the allowed values in one constant in your codebase and reference SUPPORTED_PAYLOAD_FIELDS from litellm when available","Watch litellm release notes: SUPPORTED_PAYLOAD_FIELDS is a small allow-list that can change between versions"],"tags":["argilla","enum-validation","configuration","logging"],"backgroundTag":"schema-validation-failed","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}