Class: Telnyx::Resources::MeetingSessions::Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/meeting_sessions/actions.rb,
sig/telnyx/resources/meeting_sessions/actions.rbs

Overview

Send real-time speech and chat actions to an active meeting session.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Actions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Actions.

Parameters:



86
87
88
# File 'lib/telnyx/resources/meeting_sessions/actions.rb', line 86

def initialize(client:)
  @client = client
end

Instance Method Details

#send_chat(id, text:, request_options: {}) ⇒ Telnyx::Models::MeetingSessions::ActionAcceptedResponse

Sends a chat message into a meeting session.

Parameters:

  • id (String)

    Unique identifier for the meeting session.

  • text (String)

    Chat message text to send in the meeting.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
# File 'lib/telnyx/resources/meeting_sessions/actions.rb', line 21

def send_chat(id, params)
  parsed, options = Telnyx::MeetingSessions::ActionSendChatParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["meeting_sessions/%1$s/actions/send_chat", id],
    body: parsed,
    model: Telnyx::MeetingSessions::ActionAcceptedResponse,
    options: options
  )
end

#speak(id, text:, interrupt: nil, voice: nil, request_options: {}) ⇒ Telnyx::Models::MeetingSessions::ActionAcceptedResponse

Some parameter documentations has been truncated, see Models::MeetingSessions::ActionSpeakParams for more details.

Sends audio / text-to-speech into a meeting session.

Parameters:

  • id (String)

    Unique identifier for the meeting session.

  • text (String)

    Text for the bot to speak.

  • interrupt (Boolean)

    If true, interrupt any currently playing audio to speak this text immediately.

  • voice (String)

    Voice identifier to use for this utterance. When supplied, it overrides the sess

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



52
53
54
55
56
57
58
59
60
61
# File 'lib/telnyx/resources/meeting_sessions/actions.rb', line 52

def speak(id, params)
  parsed, options = Telnyx::MeetingSessions::ActionSpeakParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["meeting_sessions/%1$s/actions/speak", id],
    body: parsed,
    model: Telnyx::MeetingSessions::ActionAcceptedResponse,
    options: options
  )
end

#stop_speaking(id, request_options: {}) ⇒ Telnyx::Models::MeetingSessions::ActionAcceptedResponse

Stops any active text-to-speech playback in a meeting session.

Parameters:

  • id (String)

    Unique identifier for the meeting session.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



74
75
76
77
78
79
80
81
# File 'lib/telnyx/resources/meeting_sessions/actions.rb', line 74

def stop_speaking(id, params = {})
  @client.request(
    method: :post,
    path: ["meeting_sessions/%1$s/actions/stop_speaking", id],
    model: Telnyx::MeetingSessions::ActionAcceptedResponse,
    options: params[:request_options]
  )
end