Skip to main content

Function: createCodeScorerVersion()

function createCodeScorerVersion(
  scorerId: string,
  codeContent: string,
  validationResult?: string,
): Promise<BaseScorerVersionResponse>;
Defined in: src/utils/scorers.ts Creates a code-based scorer version by uploading code content.

Parameters

scorerId

string The ID of the scorer to create a version for.

codeContent

string The Python code content for the scorer. Must include a function named scorer_fn with a return type annotation.

validationResult?

string (Optional) Validation result JSON string from validateCodeScorer.

Returns

Promise<BaseScorerVersionResponse> A promise that resolves to the created scorer version.