> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# createCodeScorerVersion

***

# Function: createCodeScorerVersion()

```ts theme={null}
function createCodeScorerVersion(
  scorerId: string,
  codeContent: string,
  validationResult?: string,
): Promise<BaseScorerVersionResponse>;
```

Defined in: [src/utils/scorers.ts](https://github.com/rungalileo/galileo-js/blob/main/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`](/sdk-api/typescript/reference/types/type-aliases/BaseScorerVersionResponse)>

A promise that resolves to the created scorer version.
