Class: Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/calls/action_answer_params.rb

Defined Under Namespace

Modules: Interruptible, InterruptibleGreeting, TranscriptionEngine, VoiceSettings

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(url:, custom_parameters: nil, dtmf_detection: nil, greeting: nil, interruptible: nil, interruptible_greeting: nil, interruption_settings: nil, language: nil, languages: nil, provider: nil, structured_provider: nil, transcription_engine: nil, transcription_engine_config: nil, tts_provider: nil, voice: nil, voice_settings: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig for more details.

Starts a Conversation Relay session automatically when the answered/dialed call is answered. This embedded shape is supported on ‘answer` and `dial`. It uses public field names (`url`, `dtmf_detection`, `greeting`, `voice`, `language`, etc.) and maps them to the underlying Conversation Relay action. `client_state`, `tts_language`, and `transcription_language` inside this object are ignored; use the parent command’s ‘client_state` and `command_id` fields instead.

Parameters:



314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 314

class ConversationRelayConfig < Telnyx::Internal::Type::BaseModel
  # @!attribute url
  #   WebSocket URL for your Conversation Relay server. Must start with `ws://` or
  #   `wss://`.
  #
  #   @return [String]
  required :url, String

  # @!attribute custom_parameters
  #   Custom key-value parameters forwarded to the relay session as assistant dynamic
  #   variables.
  #
  #   @return [Hash{Symbol=>Object}, nil]
  optional :custom_parameters, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

  # @!attribute dtmf_detection
  #   Enable DTMF detection for the relay session.
  #
  #   @return [Boolean, nil]
  optional :dtmf_detection, Telnyx::Internal::Type::Boolean

  # @!attribute greeting
  #   Text played when the relay session starts.
  #
  #   @return [String, nil]
  optional :greeting, String

  # @!attribute interruptible
  #   Controls when caller input can interrupt assistant speech. `any` allows speech
  #   or DTMF interruptions; `none` disables interruptions; `speech` allows speech
  #   only; `dtmf` allows DTMF only.
  #
  #   @return [Symbol, Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig::Interruptible, nil]
  optional :interruptible,
           enum: -> { Telnyx::Calls::ActionAnswerParams::ConversationRelayConfig::Interruptible }

  # @!attribute interruptible_greeting
  #   Controls when caller input can interrupt assistant speech. `any` allows speech
  #   or DTMF interruptions; `none` disables interruptions; `speech` allows speech
  #   only; `dtmf` allows DTMF only.
  #
  #   @return [Symbol, Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig::InterruptibleGreeting, nil]
  optional :interruptible_greeting,
           enum: -> { Telnyx::Calls::ActionAnswerParams::ConversationRelayConfig::InterruptibleGreeting }

  # @!attribute interruption_settings
  #   Settings for handling caller interruptions during Conversation Relay speech.
  #
  #   @return [Telnyx::Models::ConversationRelayInterruptionSettings, nil]
  optional :interruption_settings, -> { Telnyx::ConversationRelayInterruptionSettings }

  # @!attribute language
  #   Default language for both text-to-speech and speech recognition.
  #
  #   @return [String, nil]
  optional :language, String

  # @!attribute languages
  #   Per-language TTS and transcription settings.
  #
  #   @return [Array<Telnyx::Models::ConversationRelayLanguage>, nil]
  optional :languages, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::ConversationRelayLanguage] }

  # @!attribute provider
  #   Structured voice provider. Must be supplied together with `structured_provider`.
  #
  #   @return [String, nil]
  optional :provider, String

  # @!attribute structured_provider
  #   Provider-specific structured voice settings. Must be supplied together with
  #   `provider`; Telnyx sends the value as the nested provider configuration for
  #   Conversation Relay.
  #
  #   @return [Hash{Symbol=>Object}, nil]
  optional :structured_provider, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

  # @!attribute transcription_engine
  #   Engine to use for speech recognition. Legacy values `A` - `Google`, `B` -
  #   `Telnyx` are supported for backward compatibility. For Conversation Relay, use
  #   this field with `transcription_engine_config`; the `transcription` object is not
  #   supported.
  #
  #   @return [Symbol, Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig::TranscriptionEngine, nil]
  optional :transcription_engine,
           enum: -> { Telnyx::Calls::ActionAnswerParams::ConversationRelayConfig::TranscriptionEngine }

  # @!attribute transcription_engine_config
  #   Engine-specific transcription settings for Conversation Relay. This accepts the
  #   same provider-specific options used by the Call Transcription Start command,
  #   such as `transcription_model`, without requiring the engine discriminator to be
  #   repeated inside this object.
  #
  #   @return [Hash{Symbol=>Object}, nil]
  optional :transcription_engine_config, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

  # @!attribute tts_provider
  #   Text-to-speech provider. If omitted, Telnyx derives it from `voice` or
  #   `provider`.
  #
  #   @return [String, nil]
  optional :tts_provider, String

  # @!attribute voice
  #   The voice to be used by the voice assistant. Currently we support ElevenLabs,
  #   Telnyx and AWS voices.
  #
  #   **Supported Providers:**
  #
  #   - **AWS:** Use `AWS.Polly.<VoiceId>` (e.g., `AWS.Polly.Joanna`). For neural
  #     voices, which provide more realistic, human-like speech, append `-Neural` to
  #     the `VoiceId` (e.g., `AWS.Polly.Joanna-Neural`). Check the
  #     [available voices](https://docs.aws.amazon.com/polly/latest/dg/available-voices.html)
  #     for compatibility.
  #   - **Azure:** Use `Azure.<VoiceId>. (e.g. Azure.en-CA-ClaraNeural,
  #     Azure.en-CA-LiamNeural, Azure.en-US-BrianMultilingualNeural,
  #     Azure.en-US-Ava:DragonHDLatestNeural. For a complete list of voices, go to
  #     [Azure Voice Gallery](https://speech.microsoft.com/portal/voicegallery).)
  #   - **ElevenLabs:** Use `ElevenLabs.<ModelId>.<VoiceId>` (e.g.,
  #     `ElevenLabs.BaseModel.John`). The `ModelId` part is optional. To use
  #     ElevenLabs, you must provide your ElevenLabs API key as an integration secret
  #     under `"voice_settings": {"api_key_ref": "<secret_id>"}`. See
  #     [integration secrets documentation](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
  #     for details. Check
  #     [available voices](https://elevenlabs.io/docs/api-reference/get-voices).
  #   - **Telnyx:** Use `Telnyx.<model_id>.<voice_id>`
  #   - **Inworld:** Use `Inworld.<ModelId>.<VoiceId>` (e.g., `Inworld.Mini.Loretta`,
  #     `Inworld.Max.Oliver`). Supported models: `Mini`, `Max`.
  #   - **xAI:** Use `xAI.<VoiceId>` (e.g., `xAI.eve`). Available voices: `eve`,
  #     `ara`, `rex`, `sal`, `leo`.
  #
  #   @return [String, nil]
  optional :voice, String

  # @!attribute voice_settings
  #   The settings associated with the voice selected
  #
  #   @return [Telnyx::Models::Calls::ElevenLabsVoiceSettings, Telnyx::Models::Calls::TelnyxVoiceSettings, Telnyx::Models::Calls::AwsVoiceSettings, Telnyx::Models::MinimaxVoiceSettings, Telnyx::Models::AzureVoiceSettings, Telnyx::Models::RimeVoiceSettings, Telnyx::Models::ResembleVoiceSettings, Telnyx::Models::InworldVoiceSettings, Telnyx::Models::XaiVoiceSettings, nil]
  optional :voice_settings,
           union: -> { Telnyx::Calls::ActionAnswerParams::ConversationRelayConfig::VoiceSettings }

  # @!method initialize(url:, custom_parameters: nil, dtmf_detection: nil, greeting: nil, interruptible: nil, interruptible_greeting: nil, interruption_settings: nil, language: nil, languages: nil, provider: nil, structured_provider: nil, transcription_engine: nil, transcription_engine_config: nil, tts_provider: nil, voice: nil, voice_settings: nil)
  #   Some parameter documentations has been truncated, see
  #   {Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig} for more
  #   details.
  #
  #   Starts a Conversation Relay session automatically when the answered/dialed call
  #   is answered. This embedded shape is supported on `answer` and `dial`. It uses
  #   public field names (`url`, `dtmf_detection`, `greeting`, `voice`, `language`,
  #   etc.) and maps them to the underlying Conversation Relay action. `client_state`,
  #   `tts_language`, and `transcription_language` inside this object are ignored; use
  #   the parent command's `client_state` and `command_id` fields instead.
  #
  #   @param url [String] WebSocket URL for your Conversation Relay server. Must start with `ws://` or `ws
  #
  #   @param custom_parameters [Hash{Symbol=>Object}] Custom key-value parameters forwarded to the relay session as assistant dynamic
  #
  #   @param dtmf_detection [Boolean] Enable DTMF detection for the relay session.
  #
  #   @param greeting [String] Text played when the relay session starts.
  #
  #   @param interruptible [Symbol, Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig::Interruptible] Controls when caller input can interrupt assistant speech. `any` allows speech o
  #
  #   @param interruptible_greeting [Symbol, Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig::InterruptibleGreeting] Controls when caller input can interrupt assistant speech. `any` allows speech o
  #
  #   @param interruption_settings [Telnyx::Models::ConversationRelayInterruptionSettings] Settings for handling caller interruptions during Conversation Relay speech.
  #
  #   @param language [String] Default language for both text-to-speech and speech recognition.
  #
  #   @param languages [Array<Telnyx::Models::ConversationRelayLanguage>] Per-language TTS and transcription settings.
  #
  #   @param provider [String] Structured voice provider. Must be supplied together with `structured_provider`.
  #
  #   @param structured_provider [Hash{Symbol=>Object}] Provider-specific structured voice settings. Must be supplied together with `pro
  #
  #   @param transcription_engine [Symbol, Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig::TranscriptionEngine] Engine to use for speech recognition. Legacy values `A` - `Google`, `B` - `Telny
  #
  #   @param transcription_engine_config [Hash{Symbol=>Object}] Engine-specific transcription settings for Conversation Relay. This accepts the
  #
  #   @param tts_provider [String] Text-to-speech provider. If omitted, Telnyx derives it from `voice` or `provider
  #
  #   @param voice [String] The voice to be used by the voice assistant. Currently we support ElevenLabs, Te
  #
  #   @param voice_settings [Telnyx::Models::Calls::ElevenLabsVoiceSettings, Telnyx::Models::Calls::TelnyxVoiceSettings, Telnyx::Models::Calls::AwsVoiceSettings, Telnyx::Models::MinimaxVoiceSettings, Telnyx::Models::AzureVoiceSettings, Telnyx::Models::RimeVoiceSettings, Telnyx::Models::ResembleVoiceSettings, Telnyx::Models::InworldVoiceSettings, Telnyx::Models::XaiVoiceSettings] The settings associated with the voice selected

  # Controls when caller input can interrupt assistant speech. `any` allows speech
  # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
  # only; `dtmf` allows DTMF only.
  #
  # @see Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig#interruptible
  module Interruptible
    extend Telnyx::Internal::Type::Enum

    NONE = :none
    ANY = :any
    SPEECH = :speech
    DTMF = :dtmf

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # Controls when caller input can interrupt assistant speech. `any` allows speech
  # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
  # only; `dtmf` allows DTMF only.
  #
  # @see Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig#interruptible_greeting
  module InterruptibleGreeting
    extend Telnyx::Internal::Type::Enum

    NONE = :none
    ANY = :any
    SPEECH = :speech
    DTMF = :dtmf

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # Engine to use for speech recognition. Legacy values `A` - `Google`, `B` -
  # `Telnyx` are supported for backward compatibility. For Conversation Relay, use
  # this field with `transcription_engine_config`; the `transcription` object is not
  # supported.
  #
  # @see Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig#transcription_engine
  module TranscriptionEngine
    extend Telnyx::Internal::Type::Enum

    GOOGLE = :Google
    TELNYX = :Telnyx
    DEEPGRAM = :Deepgram
    AZURE = :Azure
    X_AI = :xAI
    ASSEMBLY_AI = :AssemblyAI
    SPEECHMATICS = :Speechmatics
    SONIOX = :Soniox
    A = :A
    B = :B

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # The settings associated with the voice selected
  #
  # @see Telnyx::Models::Calls::ActionAnswerParams::ConversationRelayConfig#voice_settings
  module VoiceSettings
    extend Telnyx::Internal::Type::Union

    discriminator :type

    variant :elevenlabs, -> { Telnyx::Calls::ElevenLabsVoiceSettings }

    variant :telnyx, -> { Telnyx::Calls::TelnyxVoiceSettings }

    variant :aws, -> { Telnyx::Calls::AwsVoiceSettings }

    variant :minimax, -> { Telnyx::MinimaxVoiceSettings }

    variant :azure, -> { Telnyx::AzureVoiceSettings }

    variant :rime, -> { Telnyx::RimeVoiceSettings }

    variant :resemble, -> { Telnyx::ResembleVoiceSettings }

    variant :inworld, -> { Telnyx::InworldVoiceSettings }

    variant :xai, -> { Telnyx::XaiVoiceSettings }

    # @!method self.variants
    #   @return [Array(Telnyx::Models::Calls::ElevenLabsVoiceSettings, Telnyx::Models::Calls::TelnyxVoiceSettings, Telnyx::Models::Calls::AwsVoiceSettings, Telnyx::Models::MinimaxVoiceSettings, Telnyx::Models::AzureVoiceSettings, Telnyx::Models::RimeVoiceSettings, Telnyx::Models::ResembleVoiceSettings, Telnyx::Models::InworldVoiceSettings, Telnyx::Models::XaiVoiceSettings)]
  end
end

Instance Attribute Details

#custom_parametersHash{Symbol=>Object}?

Custom key-value parameters forwarded to the relay session as assistant dynamic variables.

Returns:

  • (Hash{Symbol=>Object}, nil)


327
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 327

optional :custom_parameters, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

#dtmf_detectionBoolean?

Enable DTMF detection for the relay session.

Returns:

  • (Boolean, nil)


333
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 333

optional :dtmf_detection, Telnyx::Internal::Type::Boolean

#greetingString?

Text played when the relay session starts.

Returns:

  • (String, nil)


339
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 339

optional :greeting, String

#interruptibleSymbol, ...

Controls when caller input can interrupt assistant speech. ‘any` allows speech or DTMF interruptions; `none` disables interruptions; `speech` allows speech only; `dtmf` allows DTMF only.



347
348
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 347

optional :interruptible,
enum: -> { Telnyx::Calls::ActionAnswerParams::ConversationRelayConfig::Interruptible }

#interruptible_greetingSymbol, ...

Controls when caller input can interrupt assistant speech. ‘any` allows speech or DTMF interruptions; `none` disables interruptions; `speech` allows speech only; `dtmf` allows DTMF only.



356
357
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 356

optional :interruptible_greeting,
enum: -> { Telnyx::Calls::ActionAnswerParams::ConversationRelayConfig::InterruptibleGreeting }

#interruption_settingsTelnyx::Models::ConversationRelayInterruptionSettings?

Settings for handling caller interruptions during Conversation Relay speech.



363
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 363

optional :interruption_settings, -> { Telnyx::ConversationRelayInterruptionSettings }

#languageString?

Default language for both text-to-speech and speech recognition.

Returns:

  • (String, nil)


369
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 369

optional :language, String

#languagesArray<Telnyx::Models::ConversationRelayLanguage>?

Per-language TTS and transcription settings.



375
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 375

optional :languages, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::ConversationRelayLanguage] }

#providerString?

Structured voice provider. Must be supplied together with ‘structured_provider`.

Returns:

  • (String, nil)


381
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 381

optional :provider, String

#structured_providerHash{Symbol=>Object}?

Provider-specific structured voice settings. Must be supplied together with ‘provider`; Telnyx sends the value as the nested provider configuration for Conversation Relay.

Returns:

  • (Hash{Symbol=>Object}, nil)


389
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 389

optional :structured_provider, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

#transcription_engineSymbol, ...

Engine to use for speech recognition. Legacy values ‘A` - `Google`, `B` - `Telnyx` are supported for backward compatibility. For Conversation Relay, use this field with `transcription_engine_config`; the `transcription` object is not supported.



398
399
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 398

optional :transcription_engine,
enum: -> { Telnyx::Calls::ActionAnswerParams::ConversationRelayConfig::TranscriptionEngine }

#transcription_engine_configHash{Symbol=>Object}?

Engine-specific transcription settings for Conversation Relay. This accepts the same provider-specific options used by the Call Transcription Start command, such as ‘transcription_model`, without requiring the engine discriminator to be repeated inside this object.

Returns:

  • (Hash{Symbol=>Object}, nil)


408
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 408

optional :transcription_engine_config, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

#tts_providerString?

Text-to-speech provider. If omitted, Telnyx derives it from ‘voice` or `provider`.

Returns:

  • (String, nil)


415
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 415

optional :tts_provider, String

#urlString

WebSocket URL for your Conversation Relay server. Must start with ‘ws://` or `wss://`.

Returns:

  • (String)


320
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 320

required :url, String

#voiceString?

The voice to be used by the voice assistant. Currently we support ElevenLabs, Telnyx and AWS voices.

**Supported Providers:**

  • AWS: Use ‘AWS.Polly.<VoiceId>` (e.g., `AWS.Polly.Joanna`). For neural voices, which provide more realistic, human-like speech, append `-Neural` to the `VoiceId` (e.g., `AWS.Polly.Joanna-Neural`). Check the [available voices](docs.aws.amazon.com/polly/latest/dg/available-voices.html) for compatibility.

  • Azure: Use ‘Azure.<VoiceId>. (e.g. Azure.en-CA-ClaraNeural, Azure.en-CA-LiamNeural, Azure.en-US-BrianMultilingualNeural, Azure.en-US-Ava:DragonHDLatestNeural. For a complete list of voices, go to [Azure Voice Gallery](speech.microsoft.com/portal/voicegallery).)

  • ElevenLabs: Use ‘ElevenLabs.<ModelId>.<VoiceId>` (e.g., `ElevenLabs.BaseModel.John`). The `ModelId` part is optional. To use ElevenLabs, you must provide your ElevenLabs API key as an integration secret under `“voice_settings”: “<secret_id>”`. See [integration secrets documentation](developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret) for details. Check [available voices](elevenlabs.io/docs/api-reference/get-voices).

  • Telnyx: Use ‘Telnyx.<model_id>.<voice_id>`

  • Inworld: Use ‘Inworld.<ModelId>.<VoiceId>` (e.g., `Inworld.Mini.Loretta`, `Inworld.Max.Oliver`). Supported models: `Mini`, `Max`.

  • xAI: Use ‘xAI.<VoiceId>` (e.g., `xAI.eve`). Available voices: `eve`, `ara`, `rex`, `sal`, `leo`.

Returns:

  • (String, nil)


446
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 446

optional :voice, String

#voice_settingsTelnyx::Models::Calls::ElevenLabsVoiceSettings, ...

The settings associated with the voice selected



452
453
# File 'lib/telnyx/models/calls/action_answer_params.rb', line 452

optional :voice_settings,
union: -> { Telnyx::Calls::ActionAnswerParams::ConversationRelayConfig::VoiceSettings }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/telnyx/models/calls/action_answer_params.rb', line 512