{"record":{"id":"d1f5abab55ded964","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-eval-id-but-recei-d1f5ab","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/runs.py","lineNumber":104,"sourceCode":"          metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful\n              for storing additional information about the object in a structured format, and\n              querying for objects via API or the dashboard.\n\n              Keys are strings with a maximum length of 64 characters. Values are strings with\n              a maximum length of 512 characters.\n\n          name: The name of the run.\n\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        return self._post(\n            path_template(\"/evals/{eval_id}/runs\", eval_id=eval_id),\n            body=maybe_transform(\n                {\n                    \"data_source\": data_source,\n                    \"metadata\": metadata,\n                    \"name\": name,\n                },\n                run_create_params.RunCreateParams,\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=RunCreateResponse,","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/evals/runs/runs.py#L86-L122","documentation":"The sync EvalRun.create() method validates that eval_id is truthy before POSTing to /evals/{eval_id}/runs. The id is a path parameter, so an empty value would produce an invalid URL; the SDK raises ValueError before any request is sent.","triggerScenarios":"Calling client.evals.runs.create(eval_id='', data_source=..., ...) (or with None) on the sync client.","commonSituations":"Eval id read from env/config that is unset, previous eval-creation step failed so the variable stayed empty, or placeholder text left in copied example code.","solutions":["Ensure eval_id is the id of an existing eval (from client.evals.create(...).id or client.evals.retrieve(...).id).","Verify the earlier eval-creation call succeeded before starting a run.","Validate config/env values at startup.","Add a guard before create()."],"exampleFix":"# before\nrun = client.evals.runs.create(eval_id=eval_id, data_source=data_source)\n\n# after\nif not eval_id:\n    raise ValueError(f\"eval_id is required, got {eval_id!r}\")\nrun = client.evals.runs.create(eval_id=eval_id, data_source=data_source)","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    run = client.evals.runs.create(eval_id=eval_id, data_source=data_source)\nexcept ValueError as e:\n    if 'eval_id' in str(e):\n        raise ValueError(f'Cannot start run: {e}') from e\n    raise","preventionTips":["Create the eval first and store its id before starting runs.","Validate config-sourced eval ids at startup.","Never pass placeholder strings like '<eval_id>'."],"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"}