{"record":{"id":"2bf9dbc5fca5ac61","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-output-item-id-bu","errorCode":null,"errorMessage":"Expected a non-empty value for `output_item_id` but received {output_item_id!r}","messagePattern":"Expected a non-empty value for `output_item_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/evals/runs/output_items.py","lineNumber":76,"sourceCode":"    ) -> OutputItemRetrieveResponse:\n        \"\"\"\n        Get an evaluation run output item by ID.\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 eval_id:\n            raise ValueError(f\"Expected a non-empty value for `eval_id` but received {eval_id!r}\")\n        if not run_id:\n            raise ValueError(f\"Expected a non-empty value for `run_id` but received {run_id!r}\")\n        if not output_item_id:\n            raise ValueError(f\"Expected a non-empty value for `output_item_id` but received {output_item_id!r}\")\n        return self._get(\n            path_template(\n                \"/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}\",\n                eval_id=eval_id,\n                run_id=run_id,\n                output_item_id=output_item_id,\n            ),\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=OutputItemRetrieveResponse,\n        )\n\n    def list(","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/evals/runs/output_items.py#L58-L94","documentation":"The sync EvalRunOutputItem.retrieve() method requires output_item_id to be non-empty since it forms the final path segment of /evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}. The SDK raises ValueError client-side to avoid issuing a request with a malformed identifier.","triggerScenarios":"Calling client.evals.runs.output_items.retrieve() with output_item_id='' or None. Typically happens when looping over output items from a listing and one entry has an empty/missing id.","commonSituations":"Iterating results where some records lack ids, referencing the wrong attribute name (e.g. item.ref instead of item.id), or passing an index/None by mistake.","solutions":["Confirm you are reading the id field from the output item object you obtained from output_items.list().","If iterating, skip entries whose id is falsy.","Add a pre-call guard for output_item_id.","Check for attribute typos on the item object (use the documented field name)."],"exampleFix":"# before\nitem = client.evals.runs.output_items.retrieve(eval_id, run_id, output_item_id)\n\n# after\nif not output_item_id:\n    continue  # or raise with context\nitem = client.evals.runs.output_items.retrieve(eval_id, run_id, output_item_id)","handlingStrategy":"validation","validationCode":"if not isinstance(output_item_id, str) or not output_item_id.strip():\n    raise ValueError(f\"output_item_id must be a non-empty string, got {output_item_id!r}\")","typeGuard":"def is_valid_output_item_id(output_item_id: object) -> bool:\n    return isinstance(output_item_id, str) and bool(output_item_id.strip())","tryCatchPattern":"try:\n    item = client.evals.runs.output_items.retrieve(eval_id=eval_id, run_id=run_id, output_item_id=output_item_id)\nexcept ValueError as e:\n    if 'output_item_id' in str(e):\n        continue  # in a loop over items\n    raise","preventionTips":["Only use ids returned by output_items.list().","Read the documented id attribute, not adjacent fields.","Filter items lacking ids before iterating."],"tags":["openai","evals","value-error","path-parameter","client-side-validation"],"backgroundTag":"empty-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}