> ## 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.

# createCustomCodeMetric

***

# Function: createCustomCodeMetric()

```ts theme={null}
function createCustomCodeMetric(
  params: CreateCustomCodeMetricParams,
): Promise<BaseScorerVersionResponse>;
```

Defined in: [src/utils/metrics.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/metrics.ts)

Creates a custom code-based metric.

## Parameters

### params

[`CreateCustomCodeMetricParams`](/sdk-api/typescript/reference/types/interfaces/CreateCustomCodeMetricParams)

The parameters for creating the custom code metric.

## Returns

`Promise`\<[`BaseScorerVersionResponse`](/sdk-api/typescript/reference/types/type-aliases/BaseScorerVersionResponse)>

A promise that resolves with the created scorer version.
