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

# VariableModality

# VariableModality

Enumeration of the supported modality types for prompt variables.

## Import

```typescript theme={null}
import type { VariableModality } from '@adaline/api';
```

## Definition

```typescript theme={null}
enum VariableModality {
  Text = 'text',
  Image = 'image',
  Pdf = 'pdf',
  Api = 'api',
  Prompt = 'prompt',
}
```

***

## Values

| Value    | String     | Description                                                                                        |
| -------- | ---------- | -------------------------------------------------------------------------------------------------- |
| `Text`   | `'text'`   | Plain text content. The most common modality — used for names, instructions, or any string value.  |
| `Image`  | `'image'`  | Image content, provided as a URL or base64-encoded data.                                           |
| `Pdf`    | `'pdf'`    | PDF document content, provided as a URL or base64-encoded data.                                    |
| `Api`    | `'api'`    | External API data source. The variable value is fetched from a configured API endpoint at runtime. |
| `Prompt` | `'prompt'` | Nested prompt reference. Allows composing prompts by embedding one prompt inside another.          |

***

## Usage

```typescript theme={null}
import type { PromptVariable, VariableModality } from '@adaline/api';

const variables: PromptVariable[] = [
  { name: 'user_name', modality: 'text' },
  { name: 'profile_picture', modality: 'image' },
  { name: 'resume', modality: 'pdf' },
  { name: 'live_weather', modality: 'api' },
  { name: 'system_instructions', modality: 'prompt' },
];

function isTextVariable(v: PromptVariable): boolean {
  return v.modality === ('text' satisfies VariableModality);
}
```

### Inspecting deployment variables

```typescript theme={null}
import { Adaline } from '@adaline/client';

const adaline = new Adaline();

const deployment = await adaline.getLatestDeployment({
  promptId: 'prompt_abc123',
  deploymentEnvironmentId: 'environment_abc123',
});

for (const variable of deployment.prompt.variables) {
  console.log(`${variable.name} (${variable.modality})`);
}
```

***

## See Also

* [PromptVariable](/docs/reference/sdk/v2/typescript/types/PromptVariable) — uses `VariableModality` for the `modality` field
