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

# AmbientOptions Type

> Configure ambient sessions with sections, diagnoses, visit context, and provider context through the `AmbientOptions` type

<Callout title="Updates" color="orange" icon="bell">
  **Updated**

  `v2.2.0+` You can pass optional visit and provider context under **`visitContext`** and **`providerContext`** to improve note generation. Set these when you call `mount` or `setAmbientOptions`.
</Callout>

Use **`AmbientOptions`** when you configure an Ambient session. Pass sections and diagnoses you already know, plus visit and provider context when you have them.

```js JavaScript theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
type VisitContext = {
  visitType?: string; // Enum from Visit Types API
  encounterType?: string; // Enum from Encounter Types API
  reasonForVisit?: string; // Max 255 characters
  chiefComplaint?: string; // Max 255 characters
};

type ProviderContext = {
  providerRole?: string; // Enum from Provider Roles API
};

type AmbientOptions = {
  sections?: Section[];
  diagnoses?: {
    values: Array<{
      codes: Array<{ code?: string; description?: string; type: "ICD10" }>;
      diagnosisNote?: string;
    }>;
  };
  visitContext?: VisitContext;
  providerContext?: ProviderContext;
};
```

<Note>
  Set the EMR encounter UUID on **`encounter.identifier`** only. Do not put an `emrEncounterId` on **`ambientOptions`**. If `encounter.identifier` is set, that is what the SDK uses. See [Encounter](/web-sdk/api-reference/types/encounter) and [Ambient interoperability](/web-sdk/guides/ambient-interoperability).
</Note>

## Properties

<ResponseField name="sections" type="Section[]" href="/web-sdk/api-reference/types/section">
  Array of clinical note LOINC sections to generate.
</ResponseField>

<ResponseField name="diagnoses" type="object" required={false}>
  **Optional** - Patient diagnoses you already know (for example from the EHR), used when Problem-Based Charting is enabled. Each diagnosis needs one ICD10 code. Use camelCase **`diagnosisNote`**. See [Existing patient diagnoses](/web-sdk/guides/ambient-problem-based-charting#existing-patient-diagnoses).
</ResponseField>

<ResponseField name="visitContext" type="object" required={false}>
  **Optional** - Visit details for this session. Nested object (not flat fields on `ambientOptions`).

  <Expandable title="visitContext fields">
    <ResponseField name="visitType" type="string" required={false}>
      Visit type enum, for example `NEW_PATIENT` or `ESTABLISHED_PATIENT`. See [Visit types](/api-reference/info/visit-types). In the Web SDK UI, this value can set the note title in the patient note list.
    </ResponseField>

    <ResponseField name="encounterType" type="string" required={false}>
      Setting of the encounter, for example `AMBULATORY`, `INPATIENT`, or `ED`.
    </ResponseField>

    <ResponseField name="reasonForVisit" type="string" required={false}>
      Free-text reason for the visit. Maximum **255 characters**.
    </ResponseField>

    <ResponseField name="chiefComplaint" type="string" required={false}>
      Patient's primary complaint. Maximum **255 characters**.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="providerContext" type="object" required={false}>
  **Optional** - Provider details for this session.

  <Expandable title="providerContext fields">
    <ResponseField name="providerRole" type="string" required={false}>
      Provider role enum, for example `PRIMARY/ATTENDING` or `CONSULTING`. See [Provider roles](/web-sdk/api-reference/providers).
    </ResponseField>
  </Expandable>
</ResponseField>
