Class: OpenAI::Resources::Realtime::Calls
- Inherits:
-
Object
- Object
- OpenAI::Resources::Realtime::Calls
- Defined in:
- lib/openai/resources/realtime/calls.rb
Instance Method Summary collapse
-
#accept(call_id, audio: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, output_modalities: nil, prompt: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: :realtime, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Realtime::CallAcceptParams for more details.
-
#hangup(call_id, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Realtime::CallHangupParams for more details.
-
#initialize(client:) ⇒ Calls
constructor
private
A new instance of Calls.
-
#refer(call_id, target_uri:, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Realtime::CallReferParams for more details.
-
#reject(call_id, status_code: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Realtime::CallRejectParams for more details.
Constructor Details
#initialize(client:) ⇒ Calls
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 Calls.
141 142 143 |
# File 'lib/openai/resources/realtime/calls.rb', line 141 def initialize(client:) @client = client end |
Instance Method Details
#accept(call_id, audio: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, output_modalities: nil, prompt: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: :realtime, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Realtime::CallAcceptParams for more details.
Accept an incoming SIP call and configure the realtime session that will handle it.
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/openai/resources/realtime/calls.rb', line 46 def accept(call_id, params) parsed, = OpenAI::Realtime::CallAcceptParams.dump_request(params) @client.request( method: :post, path: ["realtime/calls/%1$s/accept", call_id], body: parsed, model: NilClass, security: {bearer_auth: true}, options: ) end |
#hangup(call_id, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Realtime::CallHangupParams for more details.
End an active Realtime API call, whether it was initiated over SIP or WebRTC.
72 73 74 75 76 77 78 79 80 |
# File 'lib/openai/resources/realtime/calls.rb', line 72 def hangup(call_id, params = {}) @client.request( method: :post, path: ["realtime/calls/%1$s/hangup", call_id], model: NilClass, security: {bearer_auth: true}, options: params[:request_options] ) end |
#refer(call_id, target_uri:, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Realtime::CallReferParams for more details.
Transfer an active SIP call to a new destination using the SIP REFER verb.
98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/openai/resources/realtime/calls.rb', line 98 def refer(call_id, params) parsed, = OpenAI::Realtime::CallReferParams.dump_request(params) @client.request( method: :post, path: ["realtime/calls/%1$s/refer", call_id], body: parsed, model: NilClass, security: {bearer_auth: true}, options: ) end |
#reject(call_id, status_code: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Realtime::CallRejectParams for more details.
Decline an incoming SIP call by returning a SIP status code to the caller.
126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/openai/resources/realtime/calls.rb', line 126 def reject(call_id, params = {}) parsed, = OpenAI::Realtime::CallRejectParams.dump_request(params) @client.request( method: :post, path: ["realtime/calls/%1$s/reject", call_id], body: parsed, model: NilClass, security: {bearer_auth: true}, options: ) end |