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

# runExperiment

***

# Function: runExperiment()

```ts theme={null}
function runExperiment<T>(
  params: RunExperimentParams<T>,
): Promise<RunExperimentOutput>;
```

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

Runs an experiment by processing each row of a dataset through a specified function or prompt template.
If metrics are provided, they will be used to evaluate the experiment.

## Type Parameters

### T

`T` *extends* `Record`\<`string`, `unknown`>

## Parameters

### params

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

The experiment run parameters.

## Returns

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

A promise that resolves to the experiment run output.
