Attempting to create an eval run via API using the Node SDK fails with an error message:
Unknown parameter: 'data_source.sampling_params.max_completion_tokens'. Did you mean 'max_completions_tokens'?
The Node SDK defines max_completion_tokens (incorrect) but the OpenAPI spec defines max_completions_tokens (correct):
github:openai/openai-node/blob/7a97bfcf1ea071bc605c654161cc0e4867d22960/src/resources/evals/runs/runs.ts#L2657
export interface SamplingParams {
/**
* The maximum number of tokens in the generated output.
*/
max_completion_tokens?: number;
OpenAI spec was “manually updated” ~7 months ago, but also confirmed the downloadable openapi.documented.yml (see openai-openapi/README.md) has the same property name:
github:openai/openai-openapi/blob/manual_spec/openapi.yaml#L4003`
sampling_params:
type: object
properties:
...
max_completion_tokens:
type: integer
description: The maximum number of tokens in the generated output.
Can workaround this with a compiler directive:
// @ts-expect-error - openai-node 6.8.1 has incorrect property name 'max_completion_tokens'
max_completions_tokens: 1000,
Since these SDKs appear to be generated from an OpenAPI spec, it is likely that all of them are incorrect, e.g. Python SDK also defines max_completion_tokens (incorrect):
github:openai/openai-python/blob/650be393dedf2a4550092817c2b82c1d04d6e9dc/src/openai/types/evals/run_create_params.py#L255
class DataSourceCreateEvalResponsesRunDataSourceSamplingParams(TypedDict, total=False):
max_completion_tokens: int
"""The maximum number of tokens in the generated output."""
(Sorry I was not allowed to use proper links)

