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

# Namo

> JavaScript API reference for the namo turn detection plugin.

## TurnDetector

End-of-turn detector; decides when the caller has finished speaking.

Selected by `model`: `'echo-large'` (the default) or `'echo-small'`.

### Constructor

```typescript theme={null}
new TurnDetector(opts: TurnDetectorOptions)
```

<ParamField path="model" type="TurnDetectorModel | string | null">
  Which detector to use: `'echo-large'` (the default) or `'echo-small'`. See TurnDetectorModel.
</ParamField>

<ParamField path="threshold" type="number">
  End-of-turn probability cutoff in \[0, 1]. Default `0.7`.
</ParamField>

<ParamField path="host" type="string | null">
  Inference service address. Falls back to the `ZRT_INFERENCE_GATEWAY` env var, then the default endpoint.
</ParamField>

<ParamField path="authToken" type="string | null">
  Inference service auth token. Default `''`.
</ParamField>

<ParamField path="baseUrl" type="string | null">
  Inference service base URL. Default `null`.
</ParamField>

### cleanup

```typescript theme={null}
cleanup(): Promise<void>
```

Tear down provider state.

### close

```typescript theme={null}
close(): Promise<void>
```

Release any resources held by the provider.

### closeEmitter

```typescript theme={null}
closeEmitter(): Promise<void>
```

Close the emitter: drop all handlers and stop emitting. Waits up to 2 seconds
for in-flight async handlers to settle before returning.

### detectEndOfUtterance

```typescript theme={null}
detectEndOfUtterance(chatContext?: any, threshold?: number): boolean
```

Whether the current EOU probability meets `threshold` (or the configured one).

<ParamField path="chatContext" type="any" />

<ParamField path="threshold" type="number" />

<ResponseField name="returns" type="boolean" />

### emit

```typescript theme={null}
emit(event: string, ...args: any[]): void
```

<ParamField path="event" type="string" required />

### getEouProbability

```typescript theme={null}
getEouProbability(_chatContext?: any): number
```

Latest end-of-utterance probability 0-1 (defaults to `0.5` when unknown).

<ResponseField name="returns" type="number" />

### getRuntimeConfig

```typescript theme={null}
getRuntimeConfig(): Record<string, any>
```

<ResponseField name="returns" type="Record<string, any>" />

### listenerCount

```typescript theme={null}
listenerCount(event: string): number
```

<ParamField path="event" type="string" required />

<ResponseField name="returns" type="number" />

### off

```typescript theme={null}
off(event: string, handler: EventHandler): void
```

<ParamField path="event" type="string" required />

<ParamField path="handler" type="EventHandler" required />

### on

```typescript theme={null}
on(event: string, handler: EventHandler): EventHandler
```

<ParamField path="event" type="string" required />

<ParamField path="handler" type="EventHandler" required />

<ResponseField name="returns" type="EventHandler" />

### once

```typescript theme={null}
once(event: string, handler: EventHandler): EventHandler
```

<ParamField path="event" type="string" required />

<ParamField path="handler" type="EventHandler" required />

<ResponseField name="returns" type="EventHandler" />

### removeAllListeners

```typescript theme={null}
removeAllListeners(event?: string): void
```

<ParamField path="event" type="string" />

### setThreshold

```typescript theme={null}
setThreshold(threshold: number): void
```

Update the end-of-utterance threshold.

<ParamField path="threshold" type="number" required />
