revox 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +10 -0
- data/README.md +234 -0
- data/SECURITY.md +23 -0
- data/lib/revox/client.rb +86 -0
- data/lib/revox/errors.rb +228 -0
- data/lib/revox/file_part.rb +58 -0
- data/lib/revox/internal/transport/base_client.rb +570 -0
- data/lib/revox/internal/transport/pooled_net_requester.rb +210 -0
- data/lib/revox/internal/type/array_of.rb +168 -0
- data/lib/revox/internal/type/base_model.rb +529 -0
- data/lib/revox/internal/type/base_page.rb +55 -0
- data/lib/revox/internal/type/boolean.rb +77 -0
- data/lib/revox/internal/type/converter.rb +327 -0
- data/lib/revox/internal/type/enum.rb +131 -0
- data/lib/revox/internal/type/file_input.rb +110 -0
- data/lib/revox/internal/type/hash_of.rb +188 -0
- data/lib/revox/internal/type/request_parameters.rb +42 -0
- data/lib/revox/internal/type/union.rb +237 -0
- data/lib/revox/internal/type/unknown.rb +81 -0
- data/lib/revox/internal/util.rb +920 -0
- data/lib/revox/internal.rb +20 -0
- data/lib/revox/models/assistant_create_params.rb +467 -0
- data/lib/revox/models/assistant_create_response.rb +535 -0
- data/lib/revox/models/assistant_delete_params.rb +14 -0
- data/lib/revox/models/assistant_delete_response.rb +16 -0
- data/lib/revox/models/assistant_list_params.rb +14 -0
- data/lib/revox/models/assistant_list_response.rb +533 -0
- data/lib/revox/models/assistant_retrieve_params.rb +14 -0
- data/lib/revox/models/assistant_retrieve_response.rb +518 -0
- data/lib/revox/models/assistant_update_params.rb +467 -0
- data/lib/revox/models/assistant_update_response.rb +535 -0
- data/lib/revox/models/call_create_params.rb +592 -0
- data/lib/revox/models/call_create_response.rb +684 -0
- data/lib/revox/models/call_list_params.rb +29 -0
- data/lib/revox/models/call_list_response.rb +197 -0
- data/lib/revox/models/call_retrieve_params.rb +14 -0
- data/lib/revox/models/call_retrieve_response.rb +684 -0
- data/lib/revox/models/users/me_retrieve_params.rb +16 -0
- data/lib/revox/models/users/me_retrieve_response.rb +89 -0
- data/lib/revox/models/users/me_update_params.rb +22 -0
- data/lib/revox/models/users/me_update_response.rb +89 -0
- data/lib/revox/models/voice_list_params.rb +14 -0
- data/lib/revox/models/voice_list_response.rb +91 -0
- data/lib/revox/models/voice_preview_params.rb +49 -0
- data/lib/revox/models/voice_retrieve_params.rb +30 -0
- data/lib/revox/models/voice_retrieve_response.rb +39 -0
- data/lib/revox/models.rb +65 -0
- data/lib/revox/request_options.rb +77 -0
- data/lib/revox/resources/assistants.rb +180 -0
- data/lib/revox/resources/call.rb +100 -0
- data/lib/revox/resources/users/me.rb +55 -0
- data/lib/revox/resources/users.rb +18 -0
- data/lib/revox/resources/voices.rb +83 -0
- data/lib/revox/version.rb +5 -0
- data/lib/revox.rb +85 -0
- data/manifest.yaml +17 -0
- data/rbi/revox/client.rbi +58 -0
- data/rbi/revox/errors.rbi +205 -0
- data/rbi/revox/file_part.rbi +37 -0
- data/rbi/revox/internal/transport/base_client.rbi +297 -0
- data/rbi/revox/internal/transport/pooled_net_requester.rbi +82 -0
- data/rbi/revox/internal/type/array_of.rbi +104 -0
- data/rbi/revox/internal/type/base_model.rbi +299 -0
- data/rbi/revox/internal/type/base_page.rbi +42 -0
- data/rbi/revox/internal/type/boolean.rbi +58 -0
- data/rbi/revox/internal/type/converter.rbi +204 -0
- data/rbi/revox/internal/type/enum.rbi +82 -0
- data/rbi/revox/internal/type/file_input.rbi +58 -0
- data/rbi/revox/internal/type/hash_of.rbi +104 -0
- data/rbi/revox/internal/type/request_parameters.rbi +29 -0
- data/rbi/revox/internal/type/union.rbi +126 -0
- data/rbi/revox/internal/type/unknown.rbi +58 -0
- data/rbi/revox/internal/util.rbi +478 -0
- data/rbi/revox/internal.rbi +16 -0
- data/rbi/revox/models/assistant_create_params.rbi +929 -0
- data/rbi/revox/models/assistant_create_response.rbi +1089 -0
- data/rbi/revox/models/assistant_delete_params.rbi +27 -0
- data/rbi/revox/models/assistant_delete_response.rbi +26 -0
- data/rbi/revox/models/assistant_list_params.rbi +27 -0
- data/rbi/revox/models/assistant_list_response.rbi +1079 -0
- data/rbi/revox/models/assistant_retrieve_params.rbi +27 -0
- data/rbi/revox/models/assistant_retrieve_response.rbi +1024 -0
- data/rbi/revox/models/assistant_update_params.rbi +935 -0
- data/rbi/revox/models/assistant_update_response.rbi +1089 -0
- data/rbi/revox/models/call_create_params.rbi +1147 -0
- data/rbi/revox/models/call_create_response.rbi +1335 -0
- data/rbi/revox/models/call_list_params.rbi +47 -0
- data/rbi/revox/models/call_list_response.rbi +401 -0
- data/rbi/revox/models/call_retrieve_params.rbi +27 -0
- data/rbi/revox/models/call_retrieve_response.rbi +1346 -0
- data/rbi/revox/models/users/me_retrieve_params.rbi +29 -0
- data/rbi/revox/models/users/me_retrieve_response.rbi +139 -0
- data/rbi/revox/models/users/me_update_params.rbi +43 -0
- data/rbi/revox/models/users/me_update_response.rbi +139 -0
- data/rbi/revox/models/voice_list_params.rbi +25 -0
- data/rbi/revox/models/voice_list_response.rbi +204 -0
- data/rbi/revox/models/voice_preview_params.rbi +84 -0
- data/rbi/revox/models/voice_retrieve_params.rbi +59 -0
- data/rbi/revox/models/voice_retrieve_response.rbi +70 -0
- data/rbi/revox/models.rbi +27 -0
- data/rbi/revox/request_options.rbi +55 -0
- data/rbi/revox/resources/assistants.rbi +206 -0
- data/rbi/revox/resources/call.rbi +86 -0
- data/rbi/revox/resources/users/me.rbi +33 -0
- data/rbi/revox/resources/users.rbi +15 -0
- data/rbi/revox/resources/voices.rbi +58 -0
- data/rbi/revox/version.rbi +5 -0
- data/sig/revox/client.rbs +32 -0
- data/sig/revox/errors.rbs +117 -0
- data/sig/revox/file_part.rbs +21 -0
- data/sig/revox/internal/transport/base_client.rbs +133 -0
- data/sig/revox/internal/transport/pooled_net_requester.rbs +48 -0
- data/sig/revox/internal/type/array_of.rbs +48 -0
- data/sig/revox/internal/type/base_model.rbs +102 -0
- data/sig/revox/internal/type/base_page.rbs +24 -0
- data/sig/revox/internal/type/boolean.rbs +26 -0
- data/sig/revox/internal/type/converter.rbs +79 -0
- data/sig/revox/internal/type/enum.rbs +32 -0
- data/sig/revox/internal/type/file_input.rbs +25 -0
- data/sig/revox/internal/type/hash_of.rbs +48 -0
- data/sig/revox/internal/type/request_parameters.rbs +17 -0
- data/sig/revox/internal/type/union.rbs +52 -0
- data/sig/revox/internal/type/unknown.rbs +26 -0
- data/sig/revox/internal/util.rbs +185 -0
- data/sig/revox/internal.rbs +9 -0
- data/sig/revox/models/assistant_create_params.rbs +413 -0
- data/sig/revox/models/assistant_create_response.rbs +461 -0
- data/sig/revox/models/assistant_delete_params.rbs +15 -0
- data/sig/revox/models/assistant_delete_response.rbs +13 -0
- data/sig/revox/models/assistant_list_params.rbs +15 -0
- data/sig/revox/models/assistant_list_response.rbs +461 -0
- data/sig/revox/models/assistant_retrieve_params.rbs +15 -0
- data/sig/revox/models/assistant_retrieve_response.rbs +446 -0
- data/sig/revox/models/assistant_update_params.rbs +417 -0
- data/sig/revox/models/assistant_update_response.rbs +461 -0
- data/sig/revox/models/call_create_params.rbs +507 -0
- data/sig/revox/models/call_create_response.rbs +551 -0
- data/sig/revox/models/call_list_params.rbs +28 -0
- data/sig/revox/models/call_list_response.rbs +171 -0
- data/sig/revox/models/call_retrieve_params.rbs +14 -0
- data/sig/revox/models/call_retrieve_response.rbs +551 -0
- data/sig/revox/models/users/me_retrieve_params.rbs +16 -0
- data/sig/revox/models/users/me_retrieve_response.rbs +70 -0
- data/sig/revox/models/users/me_update_params.rbs +28 -0
- data/sig/revox/models/users/me_update_response.rbs +70 -0
- data/sig/revox/models/voice_list_params.rbs +14 -0
- data/sig/revox/models/voice_list_response.rbs +83 -0
- data/sig/revox/models/voice_preview_params.rbs +49 -0
- data/sig/revox/models/voice_retrieve_params.rbs +35 -0
- data/sig/revox/models/voice_retrieve_response.rbs +32 -0
- data/sig/revox/models.rbs +25 -0
- data/sig/revox/request_options.rbs +34 -0
- data/sig/revox/resources/assistants.rbs +66 -0
- data/sig/revox/resources/call.rbs +31 -0
- data/sig/revox/resources/users/me.rbs +18 -0
- data/sig/revox/resources/users.rbs +9 -0
- data/sig/revox/resources/voices.rbs +24 -0
- data/sig/revox/version.rbs +3 -0
- metadata +232 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Revox
|
|
4
|
+
module Models
|
|
5
|
+
class VoiceRetrieveParams < Revox::Internal::Type::BaseModel
|
|
6
|
+
extend Revox::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Revox::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Revox::VoiceRetrieveParams, Revox::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(Revox::VoiceRetrieveParams::Provider::OrSymbol) }
|
|
15
|
+
attr_accessor :provider
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
provider: Revox::VoiceRetrieveParams::Provider::OrSymbol,
|
|
20
|
+
request_options: Revox::RequestOptions::OrHash
|
|
21
|
+
).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(provider:, request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns(
|
|
28
|
+
{
|
|
29
|
+
provider: Revox::VoiceRetrieveParams::Provider::OrSymbol,
|
|
30
|
+
request_options: Revox::RequestOptions
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def to_hash
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
module Provider
|
|
38
|
+
extend Revox::Internal::Type::Enum
|
|
39
|
+
|
|
40
|
+
TaggedSymbol =
|
|
41
|
+
T.type_alias { T.all(Symbol, Revox::VoiceRetrieveParams::Provider) }
|
|
42
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
43
|
+
|
|
44
|
+
CARTESIA =
|
|
45
|
+
T.let(:cartesia, Revox::VoiceRetrieveParams::Provider::TaggedSymbol)
|
|
46
|
+
ELEVENLABS =
|
|
47
|
+
T.let(:elevenlabs, Revox::VoiceRetrieveParams::Provider::TaggedSymbol)
|
|
48
|
+
|
|
49
|
+
sig do
|
|
50
|
+
override.returns(
|
|
51
|
+
T::Array[Revox::VoiceRetrieveParams::Provider::TaggedSymbol]
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
def self.values
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Revox
|
|
4
|
+
module Models
|
|
5
|
+
class VoiceRetrieveResponse < Revox::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Revox::Models::VoiceRetrieveResponse, Revox::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(Revox::Models::VoiceRetrieveResponse::Voice) }
|
|
12
|
+
attr_reader :voice
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
params(voice: Revox::Models::VoiceRetrieveResponse::Voice::OrHash).void
|
|
16
|
+
end
|
|
17
|
+
attr_writer :voice
|
|
18
|
+
|
|
19
|
+
sig do
|
|
20
|
+
params(
|
|
21
|
+
voice: Revox::Models::VoiceRetrieveResponse::Voice::OrHash
|
|
22
|
+
).returns(T.attached_class)
|
|
23
|
+
end
|
|
24
|
+
def self.new(voice:)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
sig do
|
|
28
|
+
override.returns({ voice: Revox::Models::VoiceRetrieveResponse::Voice })
|
|
29
|
+
end
|
|
30
|
+
def to_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
class Voice < Revox::Internal::Type::BaseModel
|
|
34
|
+
OrHash =
|
|
35
|
+
T.type_alias do
|
|
36
|
+
T.any(
|
|
37
|
+
Revox::Models::VoiceRetrieveResponse::Voice,
|
|
38
|
+
Revox::Internal::AnyHash
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
sig { returns(String) }
|
|
43
|
+
attr_accessor :id
|
|
44
|
+
|
|
45
|
+
sig { returns(String) }
|
|
46
|
+
attr_accessor :name
|
|
47
|
+
|
|
48
|
+
sig { returns(T.nilable(String)) }
|
|
49
|
+
attr_reader :description
|
|
50
|
+
|
|
51
|
+
sig { params(description: String).void }
|
|
52
|
+
attr_writer :description
|
|
53
|
+
|
|
54
|
+
sig do
|
|
55
|
+
params(id: String, name: String, description: String).returns(
|
|
56
|
+
T.attached_class
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
def self.new(id:, name:, description: nil)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
override.returns({ id: String, name: String, description: String })
|
|
64
|
+
end
|
|
65
|
+
def to_hash
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Revox
|
|
4
|
+
AssistantCreateParams = Revox::Models::AssistantCreateParams
|
|
5
|
+
|
|
6
|
+
AssistantDeleteParams = Revox::Models::AssistantDeleteParams
|
|
7
|
+
|
|
8
|
+
AssistantListParams = Revox::Models::AssistantListParams
|
|
9
|
+
|
|
10
|
+
AssistantRetrieveParams = Revox::Models::AssistantRetrieveParams
|
|
11
|
+
|
|
12
|
+
AssistantUpdateParams = Revox::Models::AssistantUpdateParams
|
|
13
|
+
|
|
14
|
+
CallCreateParams = Revox::Models::CallCreateParams
|
|
15
|
+
|
|
16
|
+
CallListParams = Revox::Models::CallListParams
|
|
17
|
+
|
|
18
|
+
CallRetrieveParams = Revox::Models::CallRetrieveParams
|
|
19
|
+
|
|
20
|
+
Users = Revox::Models::Users
|
|
21
|
+
|
|
22
|
+
VoiceListParams = Revox::Models::VoiceListParams
|
|
23
|
+
|
|
24
|
+
VoicePreviewParams = Revox::Models::VoicePreviewParams
|
|
25
|
+
|
|
26
|
+
VoiceRetrieveParams = Revox::Models::VoiceRetrieveParams
|
|
27
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Revox
|
|
4
|
+
# Specify HTTP behaviour to use for a specific request. These options supplement
|
|
5
|
+
# or override those provided at the client level.
|
|
6
|
+
#
|
|
7
|
+
# When making a request, you can pass an actual {RequestOptions} instance, or
|
|
8
|
+
# simply pass a Hash with symbol keys matching the attributes on this class.
|
|
9
|
+
class RequestOptions < Revox::Internal::Type::BaseModel
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias { T.any(Revox::RequestOptions, Revox::Internal::AnyHash) }
|
|
12
|
+
|
|
13
|
+
# @api private
|
|
14
|
+
sig { params(opts: Revox::RequestOptions::OrHash).void }
|
|
15
|
+
def self.validate!(opts)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Idempotency key to send with request and all associated retries. Will only be
|
|
19
|
+
# sent for write requests.
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_accessor :idempotency_key
|
|
22
|
+
|
|
23
|
+
# Extra query params to send with the request. These are `.merge`’d into any
|
|
24
|
+
# `query` given at the client level.
|
|
25
|
+
sig do
|
|
26
|
+
returns(
|
|
27
|
+
T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
attr_accessor :extra_query
|
|
31
|
+
|
|
32
|
+
# Extra headers to send with the request. These are `.merged`’d into any
|
|
33
|
+
# `extra_headers` given at the client level.
|
|
34
|
+
sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) }
|
|
35
|
+
attr_accessor :extra_headers
|
|
36
|
+
|
|
37
|
+
# Extra data to send with the request. These are deep merged into any data
|
|
38
|
+
# generated as part of the normal request.
|
|
39
|
+
sig { returns(T.nilable(T.anything)) }
|
|
40
|
+
attr_accessor :extra_body
|
|
41
|
+
|
|
42
|
+
# Maximum number of retries to attempt after a failed initial request.
|
|
43
|
+
sig { returns(T.nilable(Integer)) }
|
|
44
|
+
attr_accessor :max_retries
|
|
45
|
+
|
|
46
|
+
# Request timeout in seconds.
|
|
47
|
+
sig { returns(T.nilable(Float)) }
|
|
48
|
+
attr_accessor :timeout
|
|
49
|
+
|
|
50
|
+
# Returns a new instance of RequestOptions.
|
|
51
|
+
sig { params(values: Revox::Internal::AnyHash).returns(T.attached_class) }
|
|
52
|
+
def self.new(values = {})
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Revox
|
|
4
|
+
module Resources
|
|
5
|
+
class Assistants
|
|
6
|
+
sig do
|
|
7
|
+
params(
|
|
8
|
+
name: String,
|
|
9
|
+
prompt: String,
|
|
10
|
+
background_sound:
|
|
11
|
+
T.nilable(Revox::AssistantCreateParams::BackgroundSound::OrSymbol),
|
|
12
|
+
calendly: T.nilable(Revox::AssistantCreateParams::Calendly::OrHash),
|
|
13
|
+
call_retry_config:
|
|
14
|
+
Revox::AssistantCreateParams::CallRetryConfig::OrHash,
|
|
15
|
+
end_of_call_sentence: String,
|
|
16
|
+
faq_items: T::Array[Revox::AssistantCreateParams::FaqItem::OrHash],
|
|
17
|
+
first_sentence: String,
|
|
18
|
+
first_sentence_delay_ms: Integer,
|
|
19
|
+
first_sentence_mode:
|
|
20
|
+
Revox::AssistantCreateParams::FirstSentenceMode::OrSymbol,
|
|
21
|
+
ivr_navigation_enabled: T::Boolean,
|
|
22
|
+
llm_model:
|
|
23
|
+
T.any(
|
|
24
|
+
Revox::AssistantCreateParams::LlmModel::UnionMember0::OrHash,
|
|
25
|
+
Revox::AssistantCreateParams::LlmModel::UnionMember1::OrHash
|
|
26
|
+
),
|
|
27
|
+
max_call_duration_secs: Float,
|
|
28
|
+
structured_output_config:
|
|
29
|
+
T::Array[
|
|
30
|
+
Revox::AssistantCreateParams::StructuredOutputConfig::OrHash
|
|
31
|
+
],
|
|
32
|
+
transfer_phone_number: T.nilable(String),
|
|
33
|
+
voice: Revox::AssistantCreateParams::Voice::OrHash,
|
|
34
|
+
voicemail_message: T.nilable(String),
|
|
35
|
+
webhook_url: String,
|
|
36
|
+
request_options: Revox::RequestOptions::OrHash
|
|
37
|
+
).returns(Revox::Models::AssistantCreateResponse)
|
|
38
|
+
end
|
|
39
|
+
def create(
|
|
40
|
+
name:,
|
|
41
|
+
# The prompt to use for the call. This will be given to the LLM (gpt-4.1)
|
|
42
|
+
prompt:,
|
|
43
|
+
# The background sound to play during the call. Useful to give the impression that
|
|
44
|
+
# your AI agent is in an office, in the street, or anywhere else you want.
|
|
45
|
+
background_sound: nil,
|
|
46
|
+
calendly: nil,
|
|
47
|
+
# Configuration for call retry behavior including time windows, delays, and max
|
|
48
|
+
# iterations. If not provided, defaults will be used.
|
|
49
|
+
call_retry_config: nil,
|
|
50
|
+
# Optional message to say when the agent decides to end the call.
|
|
51
|
+
end_of_call_sentence: nil,
|
|
52
|
+
# FAQ items to associate with this assistant. When provided, replaces all existing
|
|
53
|
+
# FAQ items.
|
|
54
|
+
faq_items: nil,
|
|
55
|
+
# The first sentence to use for the call. This will be given to the LLM
|
|
56
|
+
first_sentence: nil,
|
|
57
|
+
# Delay in milliseconds before speaking the first sentence. Default: 400.
|
|
58
|
+
first_sentence_delay_ms: nil,
|
|
59
|
+
# How the first sentence should be handled. "generated" means the LLM will
|
|
60
|
+
# generate a response based on the first_sentence instruction. "static" means the
|
|
61
|
+
# first_sentence will be spoken exactly as provided. "none" means the agent will
|
|
62
|
+
# not speak first and will wait for the user.
|
|
63
|
+
first_sentence_mode: nil,
|
|
64
|
+
# Enable IVR navigation tools. When enabled, the assistant can send DTMF tones and
|
|
65
|
+
# skip turns to navigate phone menus.
|
|
66
|
+
ivr_navigation_enabled: nil,
|
|
67
|
+
llm_model: nil,
|
|
68
|
+
# The maximum duration of the call in seconds. This is the maximum time the call
|
|
69
|
+
# will be allowed to run.
|
|
70
|
+
max_call_duration_secs: nil,
|
|
71
|
+
# The structured output config to use for the call. This is used to extract the
|
|
72
|
+
# data from the call (like email, name, company name, etc.).
|
|
73
|
+
structured_output_config: nil,
|
|
74
|
+
# Phone number to transfer calls to when users request to speak to a human agent
|
|
75
|
+
# in E.164 format (e.g. +1234567890).
|
|
76
|
+
transfer_phone_number: nil,
|
|
77
|
+
# The voice to use for the call. You can get the list of voices using the /voices
|
|
78
|
+
# endpoint
|
|
79
|
+
voice: nil,
|
|
80
|
+
# If set, when voicemail is detected the agent will speak this message then hang
|
|
81
|
+
# up; if null, hang up immediately.
|
|
82
|
+
voicemail_message: nil,
|
|
83
|
+
# The webhook URL to call when the call is completed.
|
|
84
|
+
webhook_url: nil,
|
|
85
|
+
request_options: {}
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
sig do
|
|
90
|
+
params(
|
|
91
|
+
id: String,
|
|
92
|
+
request_options: Revox::RequestOptions::OrHash
|
|
93
|
+
).returns(Revox::Models::AssistantRetrieveResponse)
|
|
94
|
+
end
|
|
95
|
+
def retrieve(id, request_options: {})
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
sig do
|
|
99
|
+
params(
|
|
100
|
+
id: String,
|
|
101
|
+
background_sound:
|
|
102
|
+
T.nilable(Revox::AssistantUpdateParams::BackgroundSound::OrSymbol),
|
|
103
|
+
calendly: T.nilable(Revox::AssistantUpdateParams::Calendly::OrHash),
|
|
104
|
+
call_retry_config:
|
|
105
|
+
Revox::AssistantUpdateParams::CallRetryConfig::OrHash,
|
|
106
|
+
end_of_call_sentence: String,
|
|
107
|
+
faq_items: T::Array[Revox::AssistantUpdateParams::FaqItem::OrHash],
|
|
108
|
+
first_sentence: String,
|
|
109
|
+
first_sentence_delay_ms: Integer,
|
|
110
|
+
first_sentence_mode:
|
|
111
|
+
Revox::AssistantUpdateParams::FirstSentenceMode::OrSymbol,
|
|
112
|
+
ivr_navigation_enabled: T::Boolean,
|
|
113
|
+
llm_model:
|
|
114
|
+
T.any(
|
|
115
|
+
Revox::AssistantUpdateParams::LlmModel::UnionMember0::OrHash,
|
|
116
|
+
Revox::AssistantUpdateParams::LlmModel::UnionMember1::OrHash
|
|
117
|
+
),
|
|
118
|
+
max_call_duration_secs: Float,
|
|
119
|
+
name: String,
|
|
120
|
+
prompt: String,
|
|
121
|
+
structured_output_config:
|
|
122
|
+
T::Array[
|
|
123
|
+
Revox::AssistantUpdateParams::StructuredOutputConfig::OrHash
|
|
124
|
+
],
|
|
125
|
+
transfer_phone_number: T.nilable(String),
|
|
126
|
+
voice: Revox::AssistantUpdateParams::Voice::OrHash,
|
|
127
|
+
voicemail_message: T.nilable(String),
|
|
128
|
+
webhook_url: String,
|
|
129
|
+
request_options: Revox::RequestOptions::OrHash
|
|
130
|
+
).returns(Revox::Models::AssistantUpdateResponse)
|
|
131
|
+
end
|
|
132
|
+
def update(
|
|
133
|
+
id,
|
|
134
|
+
# The background sound to play during the call. Useful to give the impression that
|
|
135
|
+
# your AI agent is in an office, in the street, or anywhere else you want.
|
|
136
|
+
background_sound: nil,
|
|
137
|
+
calendly: nil,
|
|
138
|
+
# Configuration for call retry behavior including time windows, delays, and max
|
|
139
|
+
# iterations. If not provided, defaults will be used.
|
|
140
|
+
call_retry_config: nil,
|
|
141
|
+
# Optional message to say when the agent decides to end the call.
|
|
142
|
+
end_of_call_sentence: nil,
|
|
143
|
+
# FAQ items to associate with this assistant. When provided, replaces all existing
|
|
144
|
+
# FAQ items.
|
|
145
|
+
faq_items: nil,
|
|
146
|
+
# The first sentence to use for the call. This will be given to the LLM
|
|
147
|
+
first_sentence: nil,
|
|
148
|
+
# Delay in milliseconds before speaking the first sentence. Default: 400.
|
|
149
|
+
first_sentence_delay_ms: nil,
|
|
150
|
+
# How the first sentence should be handled. "generated" means the LLM will
|
|
151
|
+
# generate a response based on the first_sentence instruction. "static" means the
|
|
152
|
+
# first_sentence will be spoken exactly as provided. "none" means the agent will
|
|
153
|
+
# not speak first and will wait for the user.
|
|
154
|
+
first_sentence_mode: nil,
|
|
155
|
+
# Enable IVR navigation tools. When enabled, the assistant can send DTMF tones and
|
|
156
|
+
# skip turns to navigate phone menus.
|
|
157
|
+
ivr_navigation_enabled: nil,
|
|
158
|
+
llm_model: nil,
|
|
159
|
+
# The maximum duration of the call in seconds. This is the maximum time the call
|
|
160
|
+
# will be allowed to run.
|
|
161
|
+
max_call_duration_secs: nil,
|
|
162
|
+
name: nil,
|
|
163
|
+
# The prompt to use for the call. This will be given to the LLM (gpt-4.1)
|
|
164
|
+
prompt: nil,
|
|
165
|
+
# The structured output config to use for the call. This is used to extract the
|
|
166
|
+
# data from the call (like email, name, company name, etc.).
|
|
167
|
+
structured_output_config: nil,
|
|
168
|
+
# Phone number to transfer calls to when users request to speak to a human agent
|
|
169
|
+
# in E.164 format (e.g. +1234567890).
|
|
170
|
+
transfer_phone_number: nil,
|
|
171
|
+
# The voice to use for the call. You can get the list of voices using the /voices
|
|
172
|
+
# endpoint
|
|
173
|
+
voice: nil,
|
|
174
|
+
# If set, when voicemail is detected the agent will speak this message then hang
|
|
175
|
+
# up; if null, hang up immediately.
|
|
176
|
+
voicemail_message: nil,
|
|
177
|
+
# The webhook URL to call when the call is completed.
|
|
178
|
+
webhook_url: nil,
|
|
179
|
+
request_options: {}
|
|
180
|
+
)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
sig do
|
|
184
|
+
params(request_options: Revox::RequestOptions::OrHash).returns(
|
|
185
|
+
Revox::Models::AssistantListResponse
|
|
186
|
+
)
|
|
187
|
+
end
|
|
188
|
+
def list(request_options: {})
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
sig do
|
|
192
|
+
params(
|
|
193
|
+
id: String,
|
|
194
|
+
request_options: Revox::RequestOptions::OrHash
|
|
195
|
+
).returns(Revox::Models::AssistantDeleteResponse)
|
|
196
|
+
end
|
|
197
|
+
def delete(id, request_options: {})
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# @api private
|
|
201
|
+
sig { params(client: Revox::Client).returns(T.attached_class) }
|
|
202
|
+
def self.new(client:)
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Revox
|
|
4
|
+
module Resources
|
|
5
|
+
class Call
|
|
6
|
+
# Place a new call order. A call order can be resolved over multiple call attempts
|
|
7
|
+
# spanning up to a few days.
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
phone_number: String,
|
|
11
|
+
assistant: Revox::CallCreateParams::Assistant::OrHash,
|
|
12
|
+
assistant_id: String,
|
|
13
|
+
concurrency: Revox::CallCreateParams::Concurrency::OrHash,
|
|
14
|
+
force_now: T::Boolean,
|
|
15
|
+
from_phone_number: String,
|
|
16
|
+
metadata: T::Hash[Symbol, String],
|
|
17
|
+
prompt_variables: T::Hash[Symbol, String],
|
|
18
|
+
scheduled_at: Revox::CallCreateParams::ScheduledAt::Variants,
|
|
19
|
+
request_options: Revox::RequestOptions::OrHash
|
|
20
|
+
).returns(Revox::Models::CallCreateResponse)
|
|
21
|
+
end
|
|
22
|
+
def create(
|
|
23
|
+
# The phone number to call in the E.164 format. Example: +1234567890
|
|
24
|
+
phone_number:,
|
|
25
|
+
# You can provide a custom assistant configuration here. If you don't provide an
|
|
26
|
+
# assistant_id, this assistant object will be used for this call.
|
|
27
|
+
assistant: nil,
|
|
28
|
+
# The ID of the assistant to use for this call.
|
|
29
|
+
assistant_id: nil,
|
|
30
|
+
# Limit the number of concurrent calls for a given concurrency key.
|
|
31
|
+
concurrency: nil,
|
|
32
|
+
# The prompt to use for the call. This will be given to the LLM (gpt-4.1)
|
|
33
|
+
force_now: nil,
|
|
34
|
+
# The phone number to use for making the call (e.g., +1234567890). If not
|
|
35
|
+
# provided, uses the default trunk.
|
|
36
|
+
from_phone_number: nil,
|
|
37
|
+
# Metadata to store with the call.
|
|
38
|
+
metadata: nil,
|
|
39
|
+
# Variables to interpolate into the prompt. Wether you use an assistant_id or an
|
|
40
|
+
# assistant object, this will be used to interpolate the variables into the
|
|
41
|
+
# prompt.
|
|
42
|
+
prompt_variables: nil,
|
|
43
|
+
# Schedule the call to start at a specific date and time (ISO 8601 format). If not
|
|
44
|
+
# provided, the call will start immediately.
|
|
45
|
+
scheduled_at: nil,
|
|
46
|
+
request_options: {}
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Get a call order by ID.
|
|
51
|
+
sig do
|
|
52
|
+
params(
|
|
53
|
+
id: String,
|
|
54
|
+
request_options: Revox::RequestOptions::OrHash
|
|
55
|
+
).returns(Revox::Models::CallRetrieveResponse)
|
|
56
|
+
end
|
|
57
|
+
def retrieve(
|
|
58
|
+
# The ID of the call to get.
|
|
59
|
+
id,
|
|
60
|
+
request_options: {}
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Get the list of call orders.
|
|
65
|
+
sig do
|
|
66
|
+
params(
|
|
67
|
+
page: Float,
|
|
68
|
+
page_size: Float,
|
|
69
|
+
request_options: Revox::RequestOptions::OrHash
|
|
70
|
+
).returns(Revox::Models::CallListResponse)
|
|
71
|
+
end
|
|
72
|
+
def list(
|
|
73
|
+
# The page number you want to get. Starting at 0.
|
|
74
|
+
page:,
|
|
75
|
+
page_size:,
|
|
76
|
+
request_options: {}
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# @api private
|
|
81
|
+
sig { params(client: Revox::Client).returns(T.attached_class) }
|
|
82
|
+
def self.new(client:)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Revox
|
|
4
|
+
module Resources
|
|
5
|
+
class Users
|
|
6
|
+
class Me
|
|
7
|
+
# Get the current authenticated user.
|
|
8
|
+
sig do
|
|
9
|
+
params(request_options: Revox::RequestOptions::OrHash).returns(
|
|
10
|
+
Revox::Models::Users::MeRetrieveResponse
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
def retrieve(request_options: {})
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Update the current authenticated user.
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
has_completed_onboarding: T::Boolean,
|
|
20
|
+
request_options: Revox::RequestOptions::OrHash
|
|
21
|
+
).returns(Revox::Models::Users::MeUpdateResponse)
|
|
22
|
+
end
|
|
23
|
+
def update(has_completed_onboarding: nil, request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# @api private
|
|
27
|
+
sig { params(client: Revox::Client).returns(T.attached_class) }
|
|
28
|
+
def self.new(client:)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Revox
|
|
4
|
+
module Resources
|
|
5
|
+
class Users
|
|
6
|
+
sig { returns(Revox::Resources::Users::Me) }
|
|
7
|
+
attr_reader :me
|
|
8
|
+
|
|
9
|
+
# @api private
|
|
10
|
+
sig { params(client: Revox::Client).returns(T.attached_class) }
|
|
11
|
+
def self.new(client:)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Revox
|
|
4
|
+
module Resources
|
|
5
|
+
class Voices
|
|
6
|
+
# Get a single voice by ID.
|
|
7
|
+
sig do
|
|
8
|
+
params(
|
|
9
|
+
id: String,
|
|
10
|
+
provider: Revox::VoiceRetrieveParams::Provider::OrSymbol,
|
|
11
|
+
request_options: Revox::RequestOptions::OrHash
|
|
12
|
+
).returns(Revox::Models::VoiceRetrieveResponse)
|
|
13
|
+
end
|
|
14
|
+
def retrieve(
|
|
15
|
+
# The voice ID to get.
|
|
16
|
+
id,
|
|
17
|
+
provider:,
|
|
18
|
+
request_options: {}
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Get the list of voices available for the call. Supports Cartesia, ElevenLabs,
|
|
23
|
+
# Inworld voices.
|
|
24
|
+
sig do
|
|
25
|
+
params(request_options: Revox::RequestOptions::OrHash).returns(
|
|
26
|
+
Revox::Models::VoiceListResponse
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
def list(request_options: {})
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Generate a voice preview audio sample for a given voice ID.
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
provider: Revox::VoicePreviewParams::Provider::OrSymbol,
|
|
36
|
+
voice_id: String,
|
|
37
|
+
text: String,
|
|
38
|
+
request_options: Revox::RequestOptions::OrHash
|
|
39
|
+
).void
|
|
40
|
+
end
|
|
41
|
+
def preview(
|
|
42
|
+
# The provider to use for the preview.
|
|
43
|
+
provider:,
|
|
44
|
+
# The voice ID to generate a preview for.
|
|
45
|
+
voice_id:,
|
|
46
|
+
# The text to generate a preview for.
|
|
47
|
+
text: nil,
|
|
48
|
+
request_options: {}
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# @api private
|
|
53
|
+
sig { params(client: Revox::Client).returns(T.attached_class) }
|
|
54
|
+
def self.new(client:)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module Revox
|
|
2
|
+
class Client < Revox::Internal::Transport::BaseClient
|
|
3
|
+
DEFAULT_MAX_RETRIES: 2
|
|
4
|
+
|
|
5
|
+
DEFAULT_TIMEOUT_IN_SECONDS: Float
|
|
6
|
+
|
|
7
|
+
DEFAULT_INITIAL_RETRY_DELAY: Float
|
|
8
|
+
|
|
9
|
+
DEFAULT_MAX_RETRY_DELAY: Float
|
|
10
|
+
|
|
11
|
+
attr_reader api_key: String
|
|
12
|
+
|
|
13
|
+
attr_reader assistants: Revox::Resources::Assistants
|
|
14
|
+
|
|
15
|
+
attr_reader call: Revox::Resources::Call
|
|
16
|
+
|
|
17
|
+
attr_reader voices: Revox::Resources::Voices
|
|
18
|
+
|
|
19
|
+
attr_reader users: Revox::Resources::Users
|
|
20
|
+
|
|
21
|
+
private def auth_headers: -> ::Hash[String, String]
|
|
22
|
+
|
|
23
|
+
def initialize: (
|
|
24
|
+
?api_key: String?,
|
|
25
|
+
?base_url: String?,
|
|
26
|
+
?max_retries: Integer,
|
|
27
|
+
?timeout: Float,
|
|
28
|
+
?initial_retry_delay: Float,
|
|
29
|
+
?max_retry_delay: Float
|
|
30
|
+
) -> void
|
|
31
|
+
end
|
|
32
|
+
end
|