{"record":{"id":"905250076acdee09","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-character-id-but","errorCode":null,"errorMessage":"Expected a non-empty value for `character_id` but received {character_id!r}","messagePattern":"Expected a non-empty value for `character_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/videos.py","lineNumber":585,"sourceCode":"        extra_headers: Headers | None = None,\n        extra_query: Query | None = None,\n        extra_body: Body | None = None,\n        timeout: float | httpx2.Timeout | None | NotGiven = not_given,\n    ) -> VideoGetCharacterResponse:\n        \"\"\"\n        Fetch a character.\n\n        Args:\n          extra_headers: Send extra headers\n\n          extra_query: Add additional query parameters to the request\n\n          extra_body: Add additional JSON properties to the request\n\n          timeout: Override the client-level default timeout for this request, in seconds\n        \"\"\"\n        if not character_id:\n            raise ValueError(f\"Expected a non-empty value for `character_id` but received {character_id!r}\")\n        return self._get(\n            path_template(\"/videos/characters/{character_id}\", character_id=character_id),\n            options=make_request_options(\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n                security={\"bearer_auth\": True},\n            ),\n            cast_to=VideoGetCharacterResponse,\n        )\n\n    @typing_extensions.deprecated(\"The Sora API is scheduled to permanently shut down on September 24, 2026.\")\n    def remix(\n        self,\n        video_id: str,\n        *,\n        prompt: str,","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/videos.py#L567-L603","documentation":"Videos.get_character retrieves a video character via GET /videos/characters/{character_id} and requires a non-empty character_id path parameter. The SDK raises ValueError client-side when the value is falsy so it never issues a request to a malformed URL.","triggerScenarios":"Calling client.videos.get_character(character_id=\"\") or with None, e.g. when iterating over a list of characters where one entry lacked an id.","commonSituations":"Mapping over character objects where some entries are dicts without an 'id' key, or referencing a character field that does not exist on the response model.","solutions":["Confirm character_id is a non-empty string before calling","Extract ids with character.id from the API response objects","Filter out entries missing ids before the loop"],"exampleFix":"// before\nfor c in characters:\n    client.videos.get_character(character_id=c.get(\"id\"))\n\n// after\nfor c in characters:\n    if c.id:\n        client.videos.get_character(character_id=c.id)","handlingStrategy":"validation","validationCode":"if not character_id:\n    skip_or_raise()","typeGuard":"def is_valid_character_id(v: object) -> TypeGuard[str]:\n    return isinstance(v, str) and bool(v.strip())","tryCatchPattern":null,"preventionTips":["Read character.id from typed models rather than raw dicts","Filter character lists for missing ids before looping"],"tags":["videos","character","path-parameter","validation"],"backgroundTag":"missing-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}