Class: Revox::Resources::Assistants

Inherits:
Object
  • Object
show all
Defined in:
lib/revox/resources/assistants.rb,
sig/revox/resources/assistants.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Assistants

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 Assistants.

Parameters:



307
308
309
# File 'lib/revox/resources/assistants.rb', line 307

def initialize(client:)
  @client = client
end

Instance Method Details

#create(name:, prompt:, after_call_sms_outcomes: nil, after_call_sms_prompt: nil, background_sound: nil, background_sound_volume: nil, calendly: nil, call_retry_config: nil, cartesia_dictionary_pronunciation_id: nil, custom_tools: nil, email_notification_address: nil, email_notification_language: nil, email_notification_outcomes: nil, end_of_call_sentence: nil, faq_items: nil, first_sentence: nil, first_sentence_delay_ms: nil, first_sentence_mode: nil, from_phone_number: nil, human_transfer_mode: nil, ivr_navigation_enabled: nil, llm_model: nil, logo_url: nil, max_call_duration_secs: nil, max_duration_end_message: nil, position: nil, prompt_flow: nil, slack: nil, sms_enabled: nil, sms_template: nil, structured_output_config: nil, structured_output_prompt: nil, stt_context: nil, stt_model: nil, thinking_sound: nil, thinking_sound_probability: nil, thinking_sound_volume: nil, transfer_phone_number: nil, type: nil, voice: nil, voicemail_message: nil, voicemail_sms_prompt: nil, warm_transfer_summary_instructions: nil, webhook_url: nil, zoho: nil, request_options: {}) ⇒ Revox::Models::AssistantCreateResponse

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

Create a new AI assistant with a custom prompt, voice, and behavior configuration. Assistants define how the AI agent behaves during calls, including the system prompt given to the LLM, the first sentence spoken, the voice provider and voice ID (Cartesia or ElevenLabs), and end-of-call behavior. Once created, reference the assistant by its ID when placing calls.

Parameters:

Returns:

See Also:



112
113
114
115
116
117
118
119
120
121
# File 'lib/revox/resources/assistants.rb', line 112

def create(params)
  parsed, options = Revox::AssistantCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "assistants",
    body: parsed,
    model: Revox::Models::AssistantCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ Revox::Models::AssistantDeleteResponse

Permanently delete an assistant by its ID. Any future calls referencing this assistant ID will fail. Existing call records that used this assistant are not affected.

Parameters:

Returns:

See Also:



295
296
297
298
299
300
301
302
# File 'lib/revox/resources/assistants.rb', line 295

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["assistants/%1$s", id],
    model: Revox::Models::AssistantDeleteResponse,
    options: params[:request_options]
  )
end

#list(request_options: {}) ⇒ Revox::Models::AssistantListResponse

Retrieve all assistants associated with your account. Each assistant in the response includes its full configuration: prompt, voice settings, and first sentence. Use this endpoint to list available assistants before placing calls.

Parameters:

Returns:

See Also:



274
275
276
277
278
279
280
281
# File 'lib/revox/resources/assistants.rb', line 274

def list(params = {})
  @client.request(
    method: :get,
    path: "assistants",
    model: Revox::Models::AssistantListResponse,
    options: params[:request_options]
  )
end

#retrieve(id, request_options: {}) ⇒ Revox::Models::AssistantRetrieveResponse

Retrieve a single assistant by its unique ID. Returns the full assistant configuration including prompt, voice settings, and first sentence mode. Useful for inspecting an assistant's current setup before updating it or placing a call.

Parameters:

Returns:

See Also:



136
137
138
139
140
141
142
143
# File 'lib/revox/resources/assistants.rb', line 136

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["assistants/%1$s", id],
    model: Revox::Models::AssistantRetrieveResponse,
    options: params[:request_options]
  )
end

#update(id, after_call_sms_outcomes: nil, after_call_sms_prompt: nil, background_sound: nil, background_sound_volume: nil, calendly: nil, call_retry_config: nil, cartesia_dictionary_pronunciation_id: nil, custom_tools: nil, email_notification_address: nil, email_notification_language: nil, email_notification_outcomes: nil, end_of_call_sentence: nil, faq_items: nil, first_sentence: nil, first_sentence_delay_ms: nil, first_sentence_mode: nil, from_phone_number: nil, human_transfer_mode: nil, ivr_navigation_enabled: nil, llm_model: nil, logo_url: nil, max_call_duration_secs: nil, max_duration_end_message: nil, name: nil, position: nil, prompt: nil, prompt_flow: nil, slack: nil, sms_enabled: nil, sms_template: nil, structured_output_config: nil, structured_output_prompt: nil, stt_context: nil, stt_model: nil, thinking_sound: nil, thinking_sound_probability: nil, thinking_sound_volume: nil, transfer_phone_number: nil, type: nil, voice: nil, voicemail_message: nil, voicemail_sms_prompt: nil, warm_transfer_summary_instructions: nil, webhook_url: nil, zoho: nil, request_options: {}) ⇒ Revox::Models::AssistantUpdateResponse

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

Update one or more fields on an existing assistant. Supports partial updates — only the fields you include in the request body will be changed. You can update the prompt, voice, first sentence, name, or any other assistant property without affecting the rest of the configuration.

Parameters:

Returns:

See Also:



252
253
254
255
256
257
258
259
260
261
# File 'lib/revox/resources/assistants.rb', line 252

def update(id, params = {})
  parsed, options = Revox::AssistantUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["assistants/%1$s", id],
    body: parsed,
    model: Revox::Models::AssistantUpdateResponse,
    options: options
  )
end