{"record":{"id":"daa88f7992e9cb17","repo":"BerriAI/litellm","slug":"input-needs-to-be-a-dictionary","errorCode":null,"errorMessage":"input needs to be a dictionary","messagePattern":"input needs to be a dictionary","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/models/team.py","lineNumber":33,"sourceCode":"from litellm.models.object_permission import LiteLLM_ObjectPermissionTable\nfrom litellm.types.llms.base import LiteLLMPydanticObjectBase\n\n\nclass MemberBase(LiteLLMPydanticObjectBase):\n    user_id: str | None = Field(\n        default=None,\n        description=\"The unique ID of the user to add. Either user_id or user_email must be provided\",\n    )\n    user_email: str | None = Field(\n        default=None,\n        description=\"The email address of the user to add. Either user_id or user_email must be provided\",\n    )\n\n    @model_validator(mode=\"before\")\n    @classmethod\n    def check_user_info(cls, values):\n        if not isinstance(values, dict):\n            raise ValueError(\"input needs to be a dictionary\")\n        if values.get(\"user_id\") is None and values.get(\"user_email\") is None:\n            raise ValueError(\"Either user id or user email must be provided\")\n        return values\n\n\nclass Member(MemberBase):\n    role: Literal[\"admin\", \"user\"] = Field(\n        description=\"The role of the user within the team. 'admin' users can manage team settings and members, 'user' is a regular team member\"\n    )\n\n\nclass BudgetLimitEntry(LiteLLMPydanticObjectBase):\n    \"\"\"A single budget window with its own limit and independent reset schedule.\"\"\"\n\n    budget_duration: str\n    max_budget: float\n    reset_at: datetime | None = None\n","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/models/team.py#L15-L51","documentation":"Pydantic model_validator guard on MemberBase: the team-member input was not a dict (e.g. a list or scalar was posted), so field lookups like values.get('user_id') would fail. The raw input shape is at fault, not any member field.","triggerScenarios":"Thrown at litellm/models/team.py:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the team input as a dictionary matching the expected schema.","If you have a JSON string or another type, parse/convert it to a dict first."],"exampleFix":null,"handlingStrategy":"type-guard","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-14T00:17:10.932Z"}