## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://docs.typesafe.ai/llms.txt)

Use this file to discover all available pages before exploring further.

```
function choice<T>(instructions, criteria): ChoiceQuestion<T>;
```

Create a question that selects between named alternatives.

## Type Parameters

### T

`T` _extends_ [`ChoiceCriteria`](https://docs.typesafe.ai/sdk/javascript/api/type-aliases/ChoiceCriteria)

## Parameters

### instructions

[`EntryType`](https://docs.typesafe.ai/sdk/javascript/api/type-aliases/EntryType) The question as text, a JSON object or array, or `null`.

### criteria

`T` Labels mapped to descriptions, or `null` for undescribed labels.

## Returns

[`ChoiceQuestion`](https://docs.typesafe.ai/sdk/javascript/api/interfaces/ChoiceQuestion) <`T`>
