vapi_server_sdk 0.4.0 → 0.5.0
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 +4 -4
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +60 -14
- data/lib/vapi_server_sdk/analytics/client.rb +41 -12
- data/lib/vapi_server_sdk/assistants/client.rb +80 -14
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/calls/client.rb +104 -6
- data/lib/vapi_server_sdk/logs/client.rb +2 -2
- data/lib/vapi_server_sdk/squads/client.rb +128 -8
- data/lib/vapi_server_sdk/test_suite_runs/client.rb +328 -0
- data/lib/vapi_server_sdk/test_suite_runs/types/test_suite_run_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/test_suite_tests/client.rb +331 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_create_request.rb +81 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_remove_response.rb +82 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_update_request.rb +81 -0
- data/lib/vapi_server_sdk/test_suites/client.rb +338 -0
- data/lib/vapi_server_sdk/test_suites/types/test_suite_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/types/{semantic_edge_condition.rb → ai_edge_condition.rb} +9 -11
- data/lib/vapi_server_sdk/types/analytics_operation_column.rb +1 -0
- data/lib/vapi_server_sdk/types/analytics_operation_operation.rb +1 -0
- data/lib/vapi_server_sdk/types/analytics_query.rb +4 -3
- data/lib/vapi_server_sdk/types/analytics_query_table.rb +9 -0
- data/lib/vapi_server_sdk/types/api_request.rb +165 -0
- data/lib/vapi_server_sdk/types/api_request_method.rb +8 -0
- data/lib/vapi_server_sdk/types/api_request_mode.rb +10 -0
- data/lib/vapi_server_sdk/types/artifact.rb +12 -2
- data/lib/vapi_server_sdk/types/artifact_plan.rb +56 -8
- data/lib/vapi_server_sdk/types/assistant.rb +27 -13
- data/lib/vapi_server_sdk/types/assistant_hook_action_base.rb +47 -0
- data/lib/vapi_server_sdk/types/assistant_hook_filter.rb +72 -0
- data/lib/vapi_server_sdk/types/assistant_hooks.rb +82 -0
- data/lib/vapi_server_sdk/types/assistant_overrides.rb +28 -14
- data/lib/vapi_server_sdk/types/assistant_overrides_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/assistant_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/azure_open_ai_credential_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/backoff_plan.rb +80 -0
- data/lib/vapi_server_sdk/types/byo_phone_number.rb +10 -1
- data/lib/vapi_server_sdk/types/byo_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/call_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls.rb +69 -0
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls_emotion.rb +26 -0
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls_speed.rb +11 -0
- data/lib/vapi_server_sdk/types/cartesia_voice.rb +24 -10
- data/lib/vapi_server_sdk/types/chat_completion_message.rb +80 -0
- data/lib/vapi_server_sdk/types/chat_completion_message_metadata.rb +94 -0
- data/lib/vapi_server_sdk/types/chat_completions_dto.rb +84 -0
- data/lib/vapi_server_sdk/types/client_inbound_message_transfer.rb +13 -3
- data/lib/vapi_server_sdk/types/client_message_conversation_update.rb +15 -2
- data/lib/vapi_server_sdk/types/client_message_hang.rb +22 -4
- data/lib/vapi_server_sdk/types/client_message_language_change_detected.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_message.rb +165 -181
- data/lib/vapi_server_sdk/types/client_message_metadata.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_model_output.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_speech_update.rb +11 -2
- data/lib/vapi_server_sdk/types/client_message_tool_calls.rb +15 -2
- data/lib/vapi_server_sdk/types/client_message_tool_calls_result.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_transcript.rb +12 -2
- data/lib/vapi_server_sdk/types/client_message_transcript_type.rb +10 -0
- data/lib/vapi_server_sdk/types/client_message_transfer_update.rb +11 -1
- data/lib/vapi_server_sdk/types/client_message_user_interrupted.rb +14 -4
- data/lib/vapi_server_sdk/types/client_message_voice_input.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_workflow_node_started.rb +67 -0
- data/lib/vapi_server_sdk/types/compliance_plan.rb +77 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto.rb +28 -14
- data/lib/vapi_server_sdk/types/create_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_test_suite_test_voice_dto.rb +90 -0
- data/lib/vapi_server_sdk/types/create_vapi_phone_number_dto.rb +12 -4
- data/lib/vapi_server_sdk/types/create_workflow_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_workflow_dto_nodes_item.rb +104 -52
- data/lib/vapi_server_sdk/types/deep_seek_model.rb +4 -3
- data/lib/vapi_server_sdk/types/deep_seek_model_model.rb +9 -0
- data/lib/vapi_server_sdk/types/deepgram_transcriber.rb +28 -2
- data/lib/vapi_server_sdk/types/deepgram_voice.rb +22 -2
- data/lib/vapi_server_sdk/types/edge.rb +9 -2
- data/lib/vapi_server_sdk/types/edge_condition.rb +32 -19
- data/lib/vapi_server_sdk/types/failed_edge_condition.rb +47 -0
- data/lib/vapi_server_sdk/types/fallback_cartesia_voice.rb +24 -9
- data/lib/vapi_server_sdk/types/fallback_deepgram_voice.rb +17 -2
- data/lib/vapi_server_sdk/types/fallback_play_ht_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_id_enum.rb +22 -20
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/format_plan.rb +22 -2
- data/lib/vapi_server_sdk/types/format_plan_formatters_enabled_item.rb +22 -0
- data/lib/vapi_server_sdk/types/gather.rb +81 -25
- data/lib/vapi_server_sdk/types/google_model_model.rb +4 -0
- data/lib/vapi_server_sdk/types/groq_model_model.rb +1 -0
- data/lib/vapi_server_sdk/types/hangup.rb +67 -0
- data/lib/vapi_server_sdk/types/hook.rb +70 -0
- data/lib/vapi_server_sdk/types/hook_on.rb +9 -0
- data/lib/vapi_server_sdk/types/invite_user_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/json_schema.rb +26 -2
- data/lib/vapi_server_sdk/types/{programmatic_edge_condition.rb → logic_edge_condition.rb} +13 -15
- data/lib/vapi_server_sdk/types/message_plan.rb +12 -2
- data/lib/vapi_server_sdk/types/open_ai_model.rb +1 -9
- data/lib/vapi_server_sdk/types/open_ai_model_fallback_models_item.rb +2 -0
- data/lib/vapi_server_sdk/types/open_ai_model_model.rb +2 -0
- data/lib/vapi_server_sdk/types/play_ht_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/rime_ai_voice_id_enum.rb +22 -20
- data/lib/vapi_server_sdk/types/rime_ai_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/say.rb +23 -14
- data/lib/vapi_server_sdk/types/say_hook.rb +81 -0
- data/lib/vapi_server_sdk/types/server.rb +17 -2
- data/lib/vapi_server_sdk/types/server_message_assistant_request.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_conversation_update.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/server_message_hang.rb +20 -2
- data/lib/vapi_server_sdk/types/server_message_knowledge_base_request.rb +14 -2
- data/lib/vapi_server_sdk/types/server_message_language_change_detected.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_message.rb +212 -237
- data/lib/vapi_server_sdk/types/server_message_model_output.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_phone_call_control.rb +18 -2
- data/lib/vapi_server_sdk/types/server_message_speech_update.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_status_update.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_status_update_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/server_message_tool_calls.rb +10 -2
- data/lib/vapi_server_sdk/types/server_message_transcript.rb +13 -2
- data/lib/vapi_server_sdk/types/server_message_transcript_type.rb +10 -0
- data/lib/vapi_server_sdk/types/server_message_transfer_destination_request.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_transfer_update.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_user_interrupted.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_voice_input.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_voice_request.rb +50 -2
- data/lib/vapi_server_sdk/types/stop_speaking_plan.rb +27 -2
- data/lib/vapi_server_sdk/types/subscription.rb +33 -5
- data/lib/vapi_server_sdk/types/sync_voice_library_dto_providers_item.rb +1 -0
- data/lib/vapi_server_sdk/types/test_suite.rb +104 -0
- data/lib/vapi_server_sdk/types/test_suite_run.rb +127 -0
- data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb +80 -0
- data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai_result.rb +9 -0
- data/lib/vapi_server_sdk/types/test_suite_run_status.rb +10 -0
- data/lib/vapi_server_sdk/types/test_suite_run_test_attempt.rb +75 -0
- data/lib/vapi_server_sdk/types/{analytics_query_dto.rb → test_suite_run_test_attempt_call.rb} +19 -17
- data/lib/vapi_server_sdk/types/test_suite_run_test_result.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suite_runs_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suite_test_scorer_ai.rb +65 -0
- data/lib/vapi_server_sdk/types/test_suite_test_voice.rb +132 -0
- data/lib/vapi_server_sdk/types/test_suite_tests_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suites_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/time_range_step.rb +1 -0
- data/lib/vapi_server_sdk/types/tool_message_start.rb +18 -2
- data/lib/vapi_server_sdk/types/transfer.rb +74 -0
- data/lib/vapi_server_sdk/types/transfer_assistant_hook_action.rb +75 -0
- data/lib/vapi_server_sdk/types/{buy_phone_number_dto_fallback_destination.rb → transfer_assistant_hook_action_destination.rb} +9 -12
- data/lib/vapi_server_sdk/types/transfer_destination_assistant.rb +46 -0
- data/lib/vapi_server_sdk/types/transfer_plan.rb +37 -1
- data/lib/vapi_server_sdk/types/transfer_plan_mode.rb +4 -0
- data/lib/vapi_server_sdk/types/trieve_knowledge_base_search_plan.rb +12 -1
- data/lib/vapi_server_sdk/types/twilio_phone_number.rb +11 -2
- data/lib/vapi_server_sdk/types/twilio_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb +90 -0
- data/lib/vapi_server_sdk/types/vapi_phone_number.rb +29 -4
- data/lib/vapi_server_sdk/types/vapi_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/vonage_phone_number.rb +11 -2
- data/lib/vapi_server_sdk/types/vonage_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/workflow.rb +1 -9
- data/lib/vapi_server_sdk/types/workflow_nodes_item.rb +104 -52
- data/lib/vapi_server_sdk/types/xai_model.rb +4 -3
- data/lib/vapi_server_sdk/types/xai_model_model.rb +10 -0
- data/lib/vapi_server_sdk.rb +21 -0
- metadata +61 -12
- data/lib/vapi_server_sdk/types/buy_phone_number_dto.rb +0 -147
- data/lib/vapi_server_sdk/types/org_with_org_user.rb +0 -262
- data/lib/vapi_server_sdk/types/org_with_org_user_channel.rb +0 -10
- data/lib/vapi_server_sdk/types/org_with_org_user_role.rb +0 -9
- data/lib/vapi_server_sdk/types/update_workflow_dto.rb +0 -82
- data/lib/vapi_server_sdk/types/update_workflow_dto_nodes_item.rb +0 -81
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vapi
|
7
|
+
class Hangup
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :name
|
10
|
+
# @return [Hash{String => Object}] This is for metadata you want to store on the task.
|
11
|
+
attr_reader :metadata
|
12
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
attr_reader :additional_properties
|
14
|
+
# @return [Object]
|
15
|
+
attr_reader :_field_set
|
16
|
+
protected :_field_set
|
17
|
+
|
18
|
+
OMIT = Object.new
|
19
|
+
|
20
|
+
# @param name [String]
|
21
|
+
# @param metadata [Hash{String => Object}] This is for metadata you want to store on the task.
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [Vapi::Hangup]
|
24
|
+
def initialize(name:, metadata: OMIT, additional_properties: nil)
|
25
|
+
@name = name
|
26
|
+
@metadata = metadata if metadata != OMIT
|
27
|
+
@additional_properties = additional_properties
|
28
|
+
@_field_set = { "name": name, "metadata": metadata }.reject do |_k, v|
|
29
|
+
v == OMIT
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Deserialize a JSON object to an instance of Hangup
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [Vapi::Hangup]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
parsed_json = JSON.parse(json_object)
|
40
|
+
name = parsed_json["name"]
|
41
|
+
metadata = parsed_json["metadata"]
|
42
|
+
new(
|
43
|
+
name: name,
|
44
|
+
metadata: metadata,
|
45
|
+
additional_properties: struct
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Serialize an instance of Hangup to a JSON object
|
50
|
+
#
|
51
|
+
# @return [String]
|
52
|
+
def to_json(*_args)
|
53
|
+
@_field_set&.to_json
|
54
|
+
end
|
55
|
+
|
56
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
57
|
+
# hash and check each fields type against the current object's property
|
58
|
+
# definitions.
|
59
|
+
#
|
60
|
+
# @param obj [Object]
|
61
|
+
# @return [Void]
|
62
|
+
def self.validate_raw(obj:)
|
63
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
64
|
+
obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "hook_on"
|
4
|
+
require_relative "say_hook"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class Hook
|
10
|
+
# @return [Vapi::HookOn]
|
11
|
+
attr_reader :on
|
12
|
+
# @return [Array<Vapi::SayHook>]
|
13
|
+
attr_reader :do_
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param on [Vapi::HookOn]
|
23
|
+
# @param do_ [Array<Vapi::SayHook>]
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [Vapi::Hook]
|
26
|
+
def initialize(on:, do_:, additional_properties: nil)
|
27
|
+
@on = on
|
28
|
+
@do_ = do_
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "on": on, "do": do_ }
|
31
|
+
end
|
32
|
+
|
33
|
+
# Deserialize a JSON object to an instance of Hook
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [Vapi::Hook]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
parsed_json = JSON.parse(json_object)
|
40
|
+
on = parsed_json["on"]
|
41
|
+
do_ = parsed_json["do"]&.map do |item|
|
42
|
+
item = item.to_json
|
43
|
+
Vapi::SayHook.from_json(json_object: item)
|
44
|
+
end
|
45
|
+
new(
|
46
|
+
on: on,
|
47
|
+
do_: do_,
|
48
|
+
additional_properties: struct
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Serialize an instance of Hook to a JSON object
|
53
|
+
#
|
54
|
+
# @return [String]
|
55
|
+
def to_json(*_args)
|
56
|
+
@_field_set&.to_json
|
57
|
+
end
|
58
|
+
|
59
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
60
|
+
# hash and check each fields type against the current object's property
|
61
|
+
# definitions.
|
62
|
+
#
|
63
|
+
# @param obj [Object]
|
64
|
+
# @return [Void]
|
65
|
+
def self.validate_raw(obj:)
|
66
|
+
obj.on.is_a?(Vapi::HookOn) != false || raise("Passed value for field obj.on is not the expected type, validation failed.")
|
67
|
+
obj.do_.is_a?(Array) != false || raise("Passed value for field obj.do_ is not the expected type, validation failed.")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -10,6 +10,8 @@ module Vapi
|
|
10
10
|
attr_reader :emails
|
11
11
|
# @return [Vapi::InviteUserDtoRole]
|
12
12
|
attr_reader :role
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :redirect_to
|
13
15
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
16
|
attr_reader :additional_properties
|
15
17
|
# @return [Object]
|
@@ -20,13 +22,17 @@ module Vapi
|
|
20
22
|
|
21
23
|
# @param emails [Array<String>]
|
22
24
|
# @param role [Vapi::InviteUserDtoRole]
|
25
|
+
# @param redirect_to [String]
|
23
26
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
24
27
|
# @return [Vapi::InviteUserDto]
|
25
|
-
def initialize(emails:, role:, additional_properties: nil)
|
28
|
+
def initialize(emails:, role:, redirect_to: OMIT, additional_properties: nil)
|
26
29
|
@emails = emails
|
27
30
|
@role = role
|
31
|
+
@redirect_to = redirect_to if redirect_to != OMIT
|
28
32
|
@additional_properties = additional_properties
|
29
|
-
@_field_set = { "emails": emails, "role": role }
|
33
|
+
@_field_set = { "emails": emails, "role": role, "redirectTo": redirect_to }.reject do |_k, v|
|
34
|
+
v == OMIT
|
35
|
+
end
|
30
36
|
end
|
31
37
|
|
32
38
|
# Deserialize a JSON object to an instance of InviteUserDto
|
@@ -38,9 +44,11 @@ module Vapi
|
|
38
44
|
parsed_json = JSON.parse(json_object)
|
39
45
|
emails = parsed_json["emails"]
|
40
46
|
role = parsed_json["role"]
|
47
|
+
redirect_to = parsed_json["redirectTo"]
|
41
48
|
new(
|
42
49
|
emails: emails,
|
43
50
|
role: role,
|
51
|
+
redirect_to: redirect_to,
|
44
52
|
additional_properties: struct
|
45
53
|
)
|
46
54
|
end
|
@@ -61,6 +69,7 @@ module Vapi
|
|
61
69
|
def self.validate_raw(obj:)
|
62
70
|
obj.emails.is_a?(Array) != false || raise("Passed value for field obj.emails is not the expected type, validation failed.")
|
63
71
|
obj.role.is_a?(Vapi::InviteUserDtoRole) != false || raise("Passed value for field obj.role is not the expected type, validation failed.")
|
72
|
+
obj.redirect_to&.is_a?(String) != false || raise("Passed value for field obj.redirect_to is not the expected type, validation failed.")
|
64
73
|
end
|
65
74
|
end
|
66
75
|
end
|
@@ -31,6 +31,12 @@ module Vapi
|
|
31
31
|
# @return [Array<String>] This is a list of properties that are required.
|
32
32
|
# This only makes sense if the type is "object".
|
33
33
|
attr_reader :required
|
34
|
+
# @return [String] This is a regex that will be used to validate data in question.
|
35
|
+
attr_reader :regex
|
36
|
+
# @return [String] This the value that will be used in filling the property.
|
37
|
+
attr_reader :value
|
38
|
+
# @return [String] This the target variable that will be filled with the value of this property.
|
39
|
+
attr_reader :target
|
34
40
|
# @return [Array<String>] This array specifies the allowed values that can be used to restrict the output
|
35
41
|
# of the model.
|
36
42
|
attr_reader :enum
|
@@ -62,17 +68,23 @@ module Vapi
|
|
62
68
|
# @param description [String] This is the description to help the model understand what it needs to output.
|
63
69
|
# @param required [Array<String>] This is a list of properties that are required.
|
64
70
|
# This only makes sense if the type is "object".
|
71
|
+
# @param regex [String] This is a regex that will be used to validate data in question.
|
72
|
+
# @param value [String] This the value that will be used in filling the property.
|
73
|
+
# @param target [String] This the target variable that will be filled with the value of this property.
|
65
74
|
# @param enum [Array<String>] This array specifies the allowed values that can be used to restrict the output
|
66
75
|
# of the model.
|
67
76
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
68
77
|
# @return [Vapi::JsonSchema]
|
69
|
-
def initialize(type:, items: OMIT, properties: OMIT, description: OMIT, required: OMIT,
|
70
|
-
additional_properties: nil)
|
78
|
+
def initialize(type:, items: OMIT, properties: OMIT, description: OMIT, required: OMIT, regex: OMIT, value: OMIT,
|
79
|
+
target: OMIT, enum: OMIT, additional_properties: nil)
|
71
80
|
@type = type
|
72
81
|
@items = items if items != OMIT
|
73
82
|
@properties = properties if properties != OMIT
|
74
83
|
@description = description if description != OMIT
|
75
84
|
@required = required if required != OMIT
|
85
|
+
@regex = regex if regex != OMIT
|
86
|
+
@value = value if value != OMIT
|
87
|
+
@target = target if target != OMIT
|
76
88
|
@enum = enum if enum != OMIT
|
77
89
|
@additional_properties = additional_properties
|
78
90
|
@_field_set = {
|
@@ -81,6 +93,9 @@ module Vapi
|
|
81
93
|
"properties": properties,
|
82
94
|
"description": description,
|
83
95
|
"required": required,
|
96
|
+
"regex": regex,
|
97
|
+
"value": value,
|
98
|
+
"target": target,
|
84
99
|
"enum": enum
|
85
100
|
}.reject do |_k, v|
|
86
101
|
v == OMIT
|
@@ -99,6 +114,9 @@ module Vapi
|
|
99
114
|
properties = parsed_json["properties"]
|
100
115
|
description = parsed_json["description"]
|
101
116
|
required = parsed_json["required"]
|
117
|
+
regex = parsed_json["regex"]
|
118
|
+
value = parsed_json["value"]
|
119
|
+
target = parsed_json["target"]
|
102
120
|
enum = parsed_json["enum"]
|
103
121
|
new(
|
104
122
|
type: type,
|
@@ -106,6 +124,9 @@ module Vapi
|
|
106
124
|
properties: properties,
|
107
125
|
description: description,
|
108
126
|
required: required,
|
127
|
+
regex: regex,
|
128
|
+
value: value,
|
129
|
+
target: target,
|
109
130
|
enum: enum,
|
110
131
|
additional_properties: struct
|
111
132
|
)
|
@@ -130,6 +151,9 @@ module Vapi
|
|
130
151
|
obj.properties&.is_a?(Hash) != false || raise("Passed value for field obj.properties is not the expected type, validation failed.")
|
131
152
|
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
132
153
|
obj.required&.is_a?(Array) != false || raise("Passed value for field obj.required is not the expected type, validation failed.")
|
154
|
+
obj.regex&.is_a?(String) != false || raise("Passed value for field obj.regex is not the expected type, validation failed.")
|
155
|
+
obj.value&.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
156
|
+
obj.target&.is_a?(String) != false || raise("Passed value for field obj.target is not the expected type, validation failed.")
|
133
157
|
obj.enum&.is_a?(Array) != false || raise("Passed value for field obj.enum is not the expected type, validation failed.")
|
134
158
|
end
|
135
159
|
end
|
@@ -4,9 +4,9 @@ require "ostruct"
|
|
4
4
|
require "json"
|
5
5
|
|
6
6
|
module Vapi
|
7
|
-
class
|
7
|
+
class LogicEdgeCondition
|
8
8
|
# @return [String]
|
9
|
-
attr_reader :
|
9
|
+
attr_reader :liquid
|
10
10
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
11
11
|
attr_reader :additional_properties
|
12
12
|
# @return [Object]
|
@@ -15,29 +15,27 @@ module Vapi
|
|
15
15
|
|
16
16
|
OMIT = Object.new
|
17
17
|
|
18
|
-
# @param
|
18
|
+
# @param liquid [String]
|
19
19
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
-
# @return [Vapi::
|
21
|
-
def initialize(
|
22
|
-
@
|
20
|
+
# @return [Vapi::LogicEdgeCondition]
|
21
|
+
def initialize(liquid:, additional_properties: nil)
|
22
|
+
@liquid = liquid
|
23
23
|
@additional_properties = additional_properties
|
24
|
-
@_field_set = { "
|
25
|
-
v == OMIT
|
26
|
-
end
|
24
|
+
@_field_set = { "liquid": liquid }
|
27
25
|
end
|
28
26
|
|
29
|
-
# Deserialize a JSON object to an instance of
|
27
|
+
# Deserialize a JSON object to an instance of LogicEdgeCondition
|
30
28
|
#
|
31
29
|
# @param json_object [String]
|
32
|
-
# @return [Vapi::
|
30
|
+
# @return [Vapi::LogicEdgeCondition]
|
33
31
|
def self.from_json(json_object:)
|
34
32
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
35
33
|
parsed_json = JSON.parse(json_object)
|
36
|
-
|
37
|
-
new(
|
34
|
+
liquid = parsed_json["liquid"]
|
35
|
+
new(liquid: liquid, additional_properties: struct)
|
38
36
|
end
|
39
37
|
|
40
|
-
# Serialize an instance of
|
38
|
+
# Serialize an instance of LogicEdgeCondition to a JSON object
|
41
39
|
#
|
42
40
|
# @return [String]
|
43
41
|
def to_json(*_args)
|
@@ -51,7 +49,7 @@ module Vapi
|
|
51
49
|
# @param obj [Object]
|
52
50
|
# @return [Void]
|
53
51
|
def self.validate_raw(obj:)
|
54
|
-
obj.
|
52
|
+
obj.liquid.is_a?(String) != false || raise("Passed value for field obj.liquid is not the expected type, validation failed.")
|
55
53
|
end
|
56
54
|
end
|
57
55
|
end
|
@@ -25,6 +25,9 @@ module Vapi
|
|
25
25
|
# the user speaks.
|
26
26
|
# @default 10
|
27
27
|
attr_reader :idle_timeout_seconds
|
28
|
+
# @return [String] This is the message that the assistant will say if the call ends due to silence.
|
29
|
+
# If unspecified, it will hang up without saying anything.
|
30
|
+
attr_reader :silence_timeout_message
|
28
31
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
29
32
|
attr_reader :additional_properties
|
30
33
|
# @return [Object]
|
@@ -50,18 +53,22 @@ module Vapi
|
|
50
53
|
# The clock starts when the assistant finishes speaking and remains active until
|
51
54
|
# the user speaks.
|
52
55
|
# @default 10
|
56
|
+
# @param silence_timeout_message [String] This is the message that the assistant will say if the call ends due to silence.
|
57
|
+
# If unspecified, it will hang up without saying anything.
|
53
58
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
54
59
|
# @return [Vapi::MessagePlan]
|
55
60
|
def initialize(idle_messages: OMIT, idle_message_max_spoken_count: OMIT, idle_timeout_seconds: OMIT,
|
56
|
-
additional_properties: nil)
|
61
|
+
silence_timeout_message: OMIT, additional_properties: nil)
|
57
62
|
@idle_messages = idle_messages if idle_messages != OMIT
|
58
63
|
@idle_message_max_spoken_count = idle_message_max_spoken_count if idle_message_max_spoken_count != OMIT
|
59
64
|
@idle_timeout_seconds = idle_timeout_seconds if idle_timeout_seconds != OMIT
|
65
|
+
@silence_timeout_message = silence_timeout_message if silence_timeout_message != OMIT
|
60
66
|
@additional_properties = additional_properties
|
61
67
|
@_field_set = {
|
62
68
|
"idleMessages": idle_messages,
|
63
69
|
"idleMessageMaxSpokenCount": idle_message_max_spoken_count,
|
64
|
-
"idleTimeoutSeconds": idle_timeout_seconds
|
70
|
+
"idleTimeoutSeconds": idle_timeout_seconds,
|
71
|
+
"silenceTimeoutMessage": silence_timeout_message
|
65
72
|
}.reject do |_k, v|
|
66
73
|
v == OMIT
|
67
74
|
end
|
@@ -77,10 +84,12 @@ module Vapi
|
|
77
84
|
idle_messages = parsed_json["idleMessages"]
|
78
85
|
idle_message_max_spoken_count = parsed_json["idleMessageMaxSpokenCount"]
|
79
86
|
idle_timeout_seconds = parsed_json["idleTimeoutSeconds"]
|
87
|
+
silence_timeout_message = parsed_json["silenceTimeoutMessage"]
|
80
88
|
new(
|
81
89
|
idle_messages: idle_messages,
|
82
90
|
idle_message_max_spoken_count: idle_message_max_spoken_count,
|
83
91
|
idle_timeout_seconds: idle_timeout_seconds,
|
92
|
+
silence_timeout_message: silence_timeout_message,
|
84
93
|
additional_properties: struct
|
85
94
|
)
|
86
95
|
end
|
@@ -102,6 +111,7 @@ module Vapi
|
|
102
111
|
obj.idle_messages&.is_a?(Array) != false || raise("Passed value for field obj.idle_messages is not the expected type, validation failed.")
|
103
112
|
obj.idle_message_max_spoken_count&.is_a?(Float) != false || raise("Passed value for field obj.idle_message_max_spoken_count is not the expected type, validation failed.")
|
104
113
|
obj.idle_timeout_seconds&.is_a?(Float) != false || raise("Passed value for field obj.idle_timeout_seconds is not the expected type, validation failed.")
|
114
|
+
obj.silence_timeout_message&.is_a?(String) != false || raise("Passed value for field obj.silence_timeout_message is not the expected type, validation failed.")
|
105
115
|
end
|
106
116
|
end
|
107
117
|
end
|
@@ -30,8 +30,6 @@ module Vapi
|
|
30
30
|
# shouldn't be specified unless you have a specific reason to do so. Vapi will
|
31
31
|
# automatically find the fastest fallbacks that make sense.
|
32
32
|
attr_reader :fallback_models
|
33
|
-
# @return [Boolean]
|
34
|
-
attr_reader :semantic_caching_enabled
|
35
33
|
# @return [Float] This is the temperature that will be used for calls. Default is 0 to leverage
|
36
34
|
# caching for lower latency.
|
37
35
|
attr_reader :temperature
|
@@ -71,7 +69,6 @@ module Vapi
|
|
71
69
|
# @param fallback_models [Array<Vapi::OpenAiModelFallbackModelsItem>] These are the fallback models that will be used if the primary model fails. This
|
72
70
|
# shouldn't be specified unless you have a specific reason to do so. Vapi will
|
73
71
|
# automatically find the fastest fallbacks that make sense.
|
74
|
-
# @param semantic_caching_enabled [Boolean]
|
75
72
|
# @param temperature [Float] This is the temperature that will be used for calls. Default is 0 to leverage
|
76
73
|
# caching for lower latency.
|
77
74
|
# @param max_tokens [Float] This is the max number of tokens that the assistant will be allowed to generate
|
@@ -89,7 +86,7 @@ module Vapi
|
|
89
86
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
90
87
|
# @return [Vapi::OpenAiModel]
|
91
88
|
def initialize(model:, messages: OMIT, tools: OMIT, tool_ids: OMIT, knowledge_base: OMIT, knowledge_base_id: OMIT,
|
92
|
-
fallback_models: OMIT,
|
89
|
+
fallback_models: OMIT, temperature: OMIT, max_tokens: OMIT, emotion_recognition_enabled: OMIT, num_fast_turns: OMIT, additional_properties: nil)
|
93
90
|
@messages = messages if messages != OMIT
|
94
91
|
@tools = tools if tools != OMIT
|
95
92
|
@tool_ids = tool_ids if tool_ids != OMIT
|
@@ -97,7 +94,6 @@ module Vapi
|
|
97
94
|
@knowledge_base_id = knowledge_base_id if knowledge_base_id != OMIT
|
98
95
|
@model = model
|
99
96
|
@fallback_models = fallback_models if fallback_models != OMIT
|
100
|
-
@semantic_caching_enabled = semantic_caching_enabled if semantic_caching_enabled != OMIT
|
101
97
|
@temperature = temperature if temperature != OMIT
|
102
98
|
@max_tokens = max_tokens if max_tokens != OMIT
|
103
99
|
@emotion_recognition_enabled = emotion_recognition_enabled if emotion_recognition_enabled != OMIT
|
@@ -111,7 +107,6 @@ module Vapi
|
|
111
107
|
"knowledgeBaseId": knowledge_base_id,
|
112
108
|
"model": model,
|
113
109
|
"fallbackModels": fallback_models,
|
114
|
-
"semanticCachingEnabled": semantic_caching_enabled,
|
115
110
|
"temperature": temperature,
|
116
111
|
"maxTokens": max_tokens,
|
117
112
|
"emotionRecognitionEnabled": emotion_recognition_enabled,
|
@@ -146,7 +141,6 @@ module Vapi
|
|
146
141
|
knowledge_base_id = parsed_json["knowledgeBaseId"]
|
147
142
|
model = parsed_json["model"]
|
148
143
|
fallback_models = parsed_json["fallbackModels"]
|
149
|
-
semantic_caching_enabled = parsed_json["semanticCachingEnabled"]
|
150
144
|
temperature = parsed_json["temperature"]
|
151
145
|
max_tokens = parsed_json["maxTokens"]
|
152
146
|
emotion_recognition_enabled = parsed_json["emotionRecognitionEnabled"]
|
@@ -159,7 +153,6 @@ module Vapi
|
|
159
153
|
knowledge_base_id: knowledge_base_id,
|
160
154
|
model: model,
|
161
155
|
fallback_models: fallback_models,
|
162
|
-
semantic_caching_enabled: semantic_caching_enabled,
|
163
156
|
temperature: temperature,
|
164
157
|
max_tokens: max_tokens,
|
165
158
|
emotion_recognition_enabled: emotion_recognition_enabled,
|
@@ -189,7 +182,6 @@ module Vapi
|
|
189
182
|
obj.knowledge_base_id&.is_a?(String) != false || raise("Passed value for field obj.knowledge_base_id is not the expected type, validation failed.")
|
190
183
|
obj.model.is_a?(Vapi::OpenAiModelModel) != false || raise("Passed value for field obj.model is not the expected type, validation failed.")
|
191
184
|
obj.fallback_models&.is_a?(Array) != false || raise("Passed value for field obj.fallback_models is not the expected type, validation failed.")
|
192
|
-
obj.semantic_caching_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.semantic_caching_enabled is not the expected type, validation failed.")
|
193
185
|
obj.temperature&.is_a?(Float) != false || raise("Passed value for field obj.temperature is not the expected type, validation failed.")
|
194
186
|
obj.max_tokens&.is_a?(Float) != false || raise("Passed value for field obj.max_tokens is not the expected type, validation failed.")
|
195
187
|
obj.emotion_recognition_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.emotion_recognition_enabled is not the expected type, validation failed.")
|
@@ -2,26 +2,6 @@
|
|
2
2
|
|
3
3
|
module Vapi
|
4
4
|
class RimeAiVoiceIdEnum
|
5
|
-
MARSH = "marsh"
|
6
|
-
BAYOU = "bayou"
|
7
|
-
CREEK = "creek"
|
8
|
-
BROOK = "brook"
|
9
|
-
FLOWER = "flower"
|
10
|
-
SPORE = "spore"
|
11
|
-
GLACIER = "glacier"
|
12
|
-
GULCH = "gulch"
|
13
|
-
ALPINE = "alpine"
|
14
|
-
COVE = "cove"
|
15
|
-
LAGOON = "lagoon"
|
16
|
-
TUNDRA = "tundra"
|
17
|
-
STEPPE = "steppe"
|
18
|
-
MESA = "mesa"
|
19
|
-
GROVE = "grove"
|
20
|
-
RAINFOREST = "rainforest"
|
21
|
-
MORAINE = "moraine"
|
22
|
-
WILDFLOWER = "wildflower"
|
23
|
-
PEAK = "peak"
|
24
|
-
BOULDER = "boulder"
|
25
5
|
ABBIE = "abbie"
|
26
6
|
ALLISON = "allison"
|
27
7
|
ALLY = "ally"
|
@@ -83,5 +63,27 @@ module Vapi
|
|
83
63
|
TYLER = "tyler"
|
84
64
|
VIV = "viv"
|
85
65
|
YADIRA = "yadira"
|
66
|
+
MARSH = "marsh"
|
67
|
+
BAYOU = "bayou"
|
68
|
+
CREEK = "creek"
|
69
|
+
BROOK = "brook"
|
70
|
+
FLOWER = "flower"
|
71
|
+
SPORE = "spore"
|
72
|
+
GLACIER = "glacier"
|
73
|
+
GULCH = "gulch"
|
74
|
+
ALPINE = "alpine"
|
75
|
+
COVE = "cove"
|
76
|
+
LAGOON = "lagoon"
|
77
|
+
TUNDRA = "tundra"
|
78
|
+
STEPPE = "steppe"
|
79
|
+
MESA = "mesa"
|
80
|
+
GROVE = "grove"
|
81
|
+
RAINFOREST = "rainforest"
|
82
|
+
MORAINE = "moraine"
|
83
|
+
WILDFLOWER = "wildflower"
|
84
|
+
PEAK = "peak"
|
85
|
+
BOULDER = "boulder"
|
86
|
+
GYPSUM = "gypsum"
|
87
|
+
ZEST = "zest"
|
86
88
|
end
|
87
89
|
end
|
@@ -6,11 +6,13 @@ require "json"
|
|
6
6
|
module Vapi
|
7
7
|
class Say
|
8
8
|
# @return [String]
|
9
|
-
attr_reader :
|
9
|
+
attr_reader :exact
|
10
10
|
# @return [String]
|
11
|
-
attr_reader :
|
11
|
+
attr_reader :prompt
|
12
12
|
# @return [String]
|
13
13
|
attr_reader :name
|
14
|
+
# @return [Hash{String => Object}] This is for metadata you want to store on the task.
|
15
|
+
attr_reader :metadata
|
14
16
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
17
|
attr_reader :additional_properties
|
16
18
|
# @return [Object]
|
@@ -19,17 +21,21 @@ module Vapi
|
|
19
21
|
|
20
22
|
OMIT = Object.new
|
21
23
|
|
22
|
-
# @param
|
23
|
-
# @param
|
24
|
+
# @param exact [String]
|
25
|
+
# @param prompt [String]
|
24
26
|
# @param name [String]
|
27
|
+
# @param metadata [Hash{String => Object}] This is for metadata you want to store on the task.
|
25
28
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
29
|
# @return [Vapi::Say]
|
27
|
-
def initialize(
|
28
|
-
@
|
29
|
-
@
|
30
|
+
def initialize(name:, exact: OMIT, prompt: OMIT, metadata: OMIT, additional_properties: nil)
|
31
|
+
@exact = exact if exact != OMIT
|
32
|
+
@prompt = prompt if prompt != OMIT
|
30
33
|
@name = name
|
34
|
+
@metadata = metadata if metadata != OMIT
|
31
35
|
@additional_properties = additional_properties
|
32
|
-
@_field_set = { "
|
36
|
+
@_field_set = { "exact": exact, "prompt": prompt, "name": name, "metadata": metadata }.reject do |_k, v|
|
37
|
+
v == OMIT
|
38
|
+
end
|
33
39
|
end
|
34
40
|
|
35
41
|
# Deserialize a JSON object to an instance of Say
|
@@ -39,13 +45,15 @@ module Vapi
|
|
39
45
|
def self.from_json(json_object:)
|
40
46
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
41
47
|
parsed_json = JSON.parse(json_object)
|
42
|
-
|
43
|
-
|
48
|
+
exact = parsed_json["exact"]
|
49
|
+
prompt = parsed_json["prompt"]
|
44
50
|
name = parsed_json["name"]
|
51
|
+
metadata = parsed_json["metadata"]
|
45
52
|
new(
|
46
|
-
|
47
|
-
|
53
|
+
exact: exact,
|
54
|
+
prompt: prompt,
|
48
55
|
name: name,
|
56
|
+
metadata: metadata,
|
49
57
|
additional_properties: struct
|
50
58
|
)
|
51
59
|
end
|
@@ -64,9 +72,10 @@ module Vapi
|
|
64
72
|
# @param obj [Object]
|
65
73
|
# @return [Void]
|
66
74
|
def self.validate_raw(obj:)
|
67
|
-
obj.
|
68
|
-
obj.
|
75
|
+
obj.exact&.is_a?(String) != false || raise("Passed value for field obj.exact is not the expected type, validation failed.")
|
76
|
+
obj.prompt&.is_a?(String) != false || raise("Passed value for field obj.prompt is not the expected type, validation failed.")
|
69
77
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
78
|
+
obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
|
70
79
|
end
|
71
80
|
end
|
72
81
|
end
|