Member Junction
    Preparing search index...

    Function BuildInworldTurnDetection

    • Builds Inworld's turn_detection block from the config bag, in this order of precedence:

      1. A raw turn_detection object is sent as given — it is Inworld's own vocabulary, so it wins outright.
      2. Otherwise the normalized turnDetection request maps onto the two modes Inworld documents:
        • Mode: 'serverVad' → { type: 'server_vad' } with threshold and silence_duration_ms from Threshold and SilenceDurationMs;
        • any other mode (or none) → { type: 'semantic_vad' } with eagerness from the flat eagerness shorthand, then the normalized Eagerness, then INWORLD_DEFAULT_VAD_EAGERNESS.

      Settings the chosen mode has no field for — Eagerness under server VAD, Threshold / SilenceDurationMs under semantic VAD, Mode: 'native', and Coverage — are named in the returned warning rather than dropped silently.

      Parameters

      Returns InworldTurnDetectionResult

      The block and the warning, if any.

      Wire-format binding point — the server_vad / semantic_vad field names follow Inworld's published turn-detection reference; verify against a live endpoint.