{"record":{"id":"816e7af591ebb380","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-eval-id-but-recei-816e7a","errorCode":null,"errorMessage":"Expected a non-empty value for `eval_id` but received {eval_id!r}","messagePattern":"Expected a non-empty value for `eval_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/evals/runs/output_items.py","lineNumber":72,"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    ) -> 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            ),","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/evals/runs/output_items.py#L54-L90","documentation":"The sync EvalRunOutputItem.retrieve() method validates that eval_id is truthy before building the request path /evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}. Because eval_id is interpolated into the URL, an empty string or None would produce a malformed path (e.g. /evals//runs/...), so the SDK raises ValueError immediately instead of sending a doomed HTTP request.","triggerScenarios":"Calling client.evals.runs.output_items.retrieve(eval_id='', run_id='run_123', output_item_id='item_abc') (or passing None / a whitespace-only id) on the synchronous client. Any code that builds eval_id dynamically (from a variable, config, or previous response) and passes it without checking it can trigger this.","commonSituations":"Loading eval ids from environment variables or config files that are unset, copying example code without replacing placeholder ids, iterating over a list where some entries are empty, or destructuring a prior response object whose field was missing and defaulted to ''.","solutions":["Check where eval_id comes from and ensure it is a non-empty string before the call (e.g. assert eval_id, log its value).","If it comes from an env var, verify the variable name and that it is set in the environment you are running.","If it comes from a previous API response (e.g. client.evals.create(...).id), inspect that response — the eval may not have been created.","Add a small guard: if not eval_id: raise ValueError('eval_id missing') with context about the caller."],"exampleFix":"// before\nitem = client.evals.runs.output_items.retrieve(eval_id=eval_id, run_id=run_id, output_item_id=output_item_id)\n\n// after\nif not eval_id:\n    raise ValueError(f\"eval_id is required, got {eval_id!r}\")\nitem = client.evals.runs.output_items.retrieve(eval_id=eval_id, run_id=run_id, output_item_id=output_item_id)","handlingStrategy":"validation","validationCode":"if not isinstance(eval_id, str) or not eval_id.strip():\n    raise ValueError(f\"eval_id must be a non-empty string, got {eval_id!r}\")","typeGuard":"def is_valid_eval_id(eval_id: object) -> bool:\n    return isinstance(eval_id, str) and bool(eval_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 'eval_id' in str(e):\n        raise ValueError(f'Skipping retrieve: {e}') from e\n    raise","preventionTips":["Validate all path-parameter ids at startup or job submission time.","Capture ids from the creating object's response (.id) rather than constructing them by hand.","Log ids before API calls during development."],"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"}