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

# Async and sync modes

> Choose between lower latency and current-turn context.

| Mode    | Context returned | Default timeout | Best for                  |
| ------- | ---------------- | --------------- | ------------------------- |
| `async` | Previous turn    | 2 seconds       | Interactive chat          |
| `sync`  | Current turn     | 30 seconds      | Evals and background work |

## Async mode (default)

```typescript theme={null}
const era = new Era({ ..., mode: "async" });
```

Async mode keeps Era's analysis out of the response path. On turn 2, Era
returns the block prepared from turn 1 while it prepares turn 2 for the next
call.

| Call   | Result                               |
| ------ | ------------------------------------ |
| Turn 1 | `""` because no earlier block exists |
| Turn 2 | Context prepared from turn 1         |
| Turn 3 | Context prepared from turn 2         |

The call still waits for a normal API round trip.

## Sync mode

```typescript theme={null}
const era = new Era({ ..., mode: "sync" });
```

Sync mode waits for Era to analyze the latest user message. It can return a
block on the first turn, but it adds the full processing time before your model
call.

Use sync mode when:

* You are running an evaluation.
* The work runs in the background.
* Current-turn context matters more than response time.

## Change the timeout

```typescript theme={null}
const era = new Era({
  mode: "sync",
  timeoutMs: 60_000,
});
```

`timeoutMs` applies to each request attempt. A timeout is treated as a transient
failure and can be retried up to `maxRetries`. If no attempt succeeds,
`turnContext()` returns `""`.

## Recommendation

Start with `async` for user-facing chat. Choose `sync` only when you have a
specific need for current-turn context.
