Skip to content
1 min read · 65 words

Function: validateOptions()

ts
function validateOptions(input: unknown): OpenAIChatCompletionsAdapterOptions;

Validates an arbitrary input against openAIChatCompletionsOptionsSchema and returns the resolved options shape. Throws E_INVALID_OPENAI_CHAT_COMPLETIONS_OPTIONS (carrying the validator's error report on cause) on failure.

Parameters

ParameterTypeDescription
inputunknownThe raw options object to validate.

Returns

OpenAIChatCompletionsAdapterOptions

The resolved options object with defaults filled in.