> ## 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

> Python API reference for the namo turn detection plugin.

<Card title="Usage guide" icon="book" href="/plugins/turn-detection/namo" horizontal>
  Setup, environment variables, and Python/JavaScript/Go usage examples.
</Card>

## TurnDetector

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

One class selected by `model`: `"namo"` (the default), `"namo-inference"`,
`"echo-small"`, or `"echo-large"`. Which extra params apply depends on the
model (see `__init__`).

### Constructor

```python theme={null}
TurnDetector(*, model: 'TurnDetectorModel | str' = 'namo', threshold: 'float' = 0.7, language: 'Optional[str]' = None, host: 'Optional[str]' = None, auth_token: 'Optional[str]' = None, base_url: 'Optional[str]' = None, **kwargs: 'Any') -> 'None'
```

<ParamField path="model" type="TurnDetectorModel | str" default="namo">
  Which detector to use: `"namo"` (the default), `"namo-inference"`, `"echo-small"`, or `"echo-large"`.
</ParamField>

<ParamField path="threshold" type="float" default="0.7">
  End-of-turn probability cutoff, 0.0–1.0. Applies to every model. Default 0.7.
</ParamField>

<ParamField path="language" type="Optional[str]">
  BCP-47 language hint. Only used by the `"namo"` model.
</ParamField>

<ParamField path="host" type="Optional[str]">
  Inference service address. Inference models only.
</ParamField>

<ParamField path="auth_token" type="Optional[str]">
  Inference service auth token. Inference models only.
</ParamField>

<ParamField path="base_url" type="Optional[str]">
  Inference service base URL. Inference models only.
</ParamField>

### aclose

```python theme={null}
def aclose(self) -> 'None'
```

Release any resources held by the provider.

### cleanup

```python theme={null}
def cleanup(self) -> 'None'
```

Perform any additional teardown required by the provider.

### detect\_end\_of\_utterance

```python theme={null}
def detect_end_of_utterance(self, chat_context: 'Any', threshold: 'Optional[float]' = None) -> 'bool'
```

Determine whether the current utterance has ended.

<ParamField path="chat_context" type="Any" required>
  The conversation context used to evaluate the utterance.
</ParamField>

<ParamField path="threshold" type="Optional[float]">
  Optional probability threshold overriding the configured one.
</ParamField>

<ResponseField name="returns" type="bool">
  `True` if the end-of-utterance probability meets or exceeds the threshold, otherwise `False`.
</ResponseField>

### emit

```python theme={null}
def emit(self, event: 'T', *args: 'Any') -> 'None'
```

Emit an event, invoking all registered handlers with the given arguments.

Handlers are called in registration order. Coroutine handlers are
scheduled on the running event loop. If the emitter is closed, the call
is a no-op.

<ParamField path="event" type="T" required>
  The event to emit.
</ParamField>

### get\_eou\_probability

```python theme={null}
def get_eou_probability(self, chat_context: 'Any') -> 'float'
```

Return the estimated probability that the current utterance has ended.

Reads the most recent detection result from the active session, falling
back to `0.5` when no result is available or the value cannot be parsed.

<ParamField path="chat_context" type="Any" required>
  The conversation context used to evaluate the utterance.
</ParamField>

<ResponseField name="returns" type="float">
  The end-of-utterance probability in the range 0.0 to 1.0.
</ResponseField>

### off

```python theme={null}
def off(self, event: 'T', callback: 'Callable[..., Any]') -> 'None'
```

Remove a previously registered handler for an event.

If the handler is not registered for the event, the call is a no-op.

<ParamField path="event" type="T" required>
  The event the handler was registered for.
</ParamField>

<ParamField path="callback" type="Callable[..., Any]" required>
  The handler to remove.
</ParamField>

### on

```python theme={null}
def on(self, event: 'T', callback: 'Callable[..., Any] | None' = None) -> 'Callable[..., Any]'
```

Register a handler for an event.

Can be used directly by passing a callback, or as a decorator when
`callback` is omitted.

<ParamField path="event" type="T" required>
  The event to listen for.
</ParamField>

<ParamField path="callback" type="Callable[..., Any] | None">
  The handler to invoke when the event is emitted. If `None`, a decorator is returned that registers the decorated function.
</ParamField>

<ResponseField name="returns" type="Callable[..., Any]">
  The registered callback when `callback` is provided, otherwise a decorator that registers and returns the function it wraps.
</ResponseField>

### set\_threshold

```python theme={null}
def set_threshold(self, threshold: 'float') -> 'None'
```

Update the end-of-utterance probability threshold.

<ParamField path="threshold" type="float" required>
  The new probability threshold.
</ParamField>
