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.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/lib/requests.rb +2 -2
  3. data/lib/types_export.rb +60 -14
  4. data/lib/vapi_server_sdk/analytics/client.rb +41 -12
  5. data/lib/vapi_server_sdk/assistants/client.rb +80 -14
  6. data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_server_messages_item.rb +1 -0
  7. data/lib/vapi_server_sdk/calls/client.rb +104 -6
  8. data/lib/vapi_server_sdk/logs/client.rb +2 -2
  9. data/lib/vapi_server_sdk/squads/client.rb +128 -8
  10. data/lib/vapi_server_sdk/test_suite_runs/client.rb +328 -0
  11. data/lib/vapi_server_sdk/test_suite_runs/types/test_suite_run_controller_find_all_paginated_request_sort_order.rb +10 -0
  12. data/lib/vapi_server_sdk/test_suite_tests/client.rb +331 -0
  13. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_create_request.rb +81 -0
  14. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_find_all_paginated_request_sort_order.rb +10 -0
  15. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_remove_response.rb +82 -0
  16. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_update_request.rb +81 -0
  17. data/lib/vapi_server_sdk/test_suites/client.rb +338 -0
  18. data/lib/vapi_server_sdk/test_suites/types/test_suite_controller_find_all_paginated_request_sort_order.rb +10 -0
  19. data/lib/vapi_server_sdk/types/{semantic_edge_condition.rb → ai_edge_condition.rb} +9 -11
  20. data/lib/vapi_server_sdk/types/analytics_operation_column.rb +1 -0
  21. data/lib/vapi_server_sdk/types/analytics_operation_operation.rb +1 -0
  22. data/lib/vapi_server_sdk/types/analytics_query.rb +4 -3
  23. data/lib/vapi_server_sdk/types/analytics_query_table.rb +9 -0
  24. data/lib/vapi_server_sdk/types/api_request.rb +165 -0
  25. data/lib/vapi_server_sdk/types/api_request_method.rb +8 -0
  26. data/lib/vapi_server_sdk/types/api_request_mode.rb +10 -0
  27. data/lib/vapi_server_sdk/types/artifact.rb +12 -2
  28. data/lib/vapi_server_sdk/types/artifact_plan.rb +56 -8
  29. data/lib/vapi_server_sdk/types/assistant.rb +27 -13
  30. data/lib/vapi_server_sdk/types/assistant_hook_action_base.rb +47 -0
  31. data/lib/vapi_server_sdk/types/assistant_hook_filter.rb +72 -0
  32. data/lib/vapi_server_sdk/types/assistant_hooks.rb +82 -0
  33. data/lib/vapi_server_sdk/types/assistant_overrides.rb +28 -14
  34. data/lib/vapi_server_sdk/types/assistant_overrides_server_messages_item.rb +1 -0
  35. data/lib/vapi_server_sdk/types/assistant_server_messages_item.rb +1 -0
  36. data/lib/vapi_server_sdk/types/azure_open_ai_credential_models_item.rb +1 -0
  37. data/lib/vapi_server_sdk/types/backoff_plan.rb +80 -0
  38. data/lib/vapi_server_sdk/types/byo_phone_number.rb +10 -1
  39. data/lib/vapi_server_sdk/types/byo_phone_number_status.rb +10 -0
  40. data/lib/vapi_server_sdk/types/call_ended_reason.rb +10 -1
  41. data/lib/vapi_server_sdk/types/cartesia_experimental_controls.rb +69 -0
  42. data/lib/vapi_server_sdk/types/cartesia_experimental_controls_emotion.rb +26 -0
  43. data/lib/vapi_server_sdk/types/cartesia_experimental_controls_speed.rb +11 -0
  44. data/lib/vapi_server_sdk/types/cartesia_voice.rb +24 -10
  45. data/lib/vapi_server_sdk/types/chat_completion_message.rb +80 -0
  46. data/lib/vapi_server_sdk/types/chat_completion_message_metadata.rb +94 -0
  47. data/lib/vapi_server_sdk/types/chat_completions_dto.rb +84 -0
  48. data/lib/vapi_server_sdk/types/client_inbound_message_transfer.rb +13 -3
  49. data/lib/vapi_server_sdk/types/client_message_conversation_update.rb +15 -2
  50. data/lib/vapi_server_sdk/types/client_message_hang.rb +22 -4
  51. data/lib/vapi_server_sdk/types/client_message_language_change_detected.rb +15 -3
  52. data/lib/vapi_server_sdk/types/client_message_message.rb +165 -181
  53. data/lib/vapi_server_sdk/types/client_message_metadata.rb +15 -3
  54. data/lib/vapi_server_sdk/types/client_message_model_output.rb +15 -3
  55. data/lib/vapi_server_sdk/types/client_message_speech_update.rb +11 -2
  56. data/lib/vapi_server_sdk/types/client_message_tool_calls.rb +15 -2
  57. data/lib/vapi_server_sdk/types/client_message_tool_calls_result.rb +15 -3
  58. data/lib/vapi_server_sdk/types/client_message_transcript.rb +12 -2
  59. data/lib/vapi_server_sdk/types/client_message_transcript_type.rb +10 -0
  60. data/lib/vapi_server_sdk/types/client_message_transfer_update.rb +11 -1
  61. data/lib/vapi_server_sdk/types/client_message_user_interrupted.rb +14 -4
  62. data/lib/vapi_server_sdk/types/client_message_voice_input.rb +15 -3
  63. data/lib/vapi_server_sdk/types/client_message_workflow_node_started.rb +67 -0
  64. data/lib/vapi_server_sdk/types/compliance_plan.rb +77 -0
  65. data/lib/vapi_server_sdk/types/create_assistant_dto.rb +28 -14
  66. data/lib/vapi_server_sdk/types/create_assistant_dto_server_messages_item.rb +1 -0
  67. data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_models_item.rb +1 -0
  68. data/lib/vapi_server_sdk/types/create_test_suite_test_voice_dto.rb +90 -0
  69. data/lib/vapi_server_sdk/types/create_vapi_phone_number_dto.rb +12 -4
  70. data/lib/vapi_server_sdk/types/create_workflow_dto.rb +2 -9
  71. data/lib/vapi_server_sdk/types/create_workflow_dto_nodes_item.rb +104 -52
  72. data/lib/vapi_server_sdk/types/deep_seek_model.rb +4 -3
  73. data/lib/vapi_server_sdk/types/deep_seek_model_model.rb +9 -0
  74. data/lib/vapi_server_sdk/types/deepgram_transcriber.rb +28 -2
  75. data/lib/vapi_server_sdk/types/deepgram_voice.rb +22 -2
  76. data/lib/vapi_server_sdk/types/edge.rb +9 -2
  77. data/lib/vapi_server_sdk/types/edge_condition.rb +32 -19
  78. data/lib/vapi_server_sdk/types/failed_edge_condition.rb +47 -0
  79. data/lib/vapi_server_sdk/types/fallback_cartesia_voice.rb +24 -9
  80. data/lib/vapi_server_sdk/types/fallback_deepgram_voice.rb +17 -2
  81. data/lib/vapi_server_sdk/types/fallback_play_ht_voice_model.rb +1 -0
  82. data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_id_enum.rb +22 -20
  83. data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_model.rb +1 -0
  84. data/lib/vapi_server_sdk/types/format_plan.rb +22 -2
  85. data/lib/vapi_server_sdk/types/format_plan_formatters_enabled_item.rb +22 -0
  86. data/lib/vapi_server_sdk/types/gather.rb +81 -25
  87. data/lib/vapi_server_sdk/types/google_model_model.rb +4 -0
  88. data/lib/vapi_server_sdk/types/groq_model_model.rb +1 -0
  89. data/lib/vapi_server_sdk/types/hangup.rb +67 -0
  90. data/lib/vapi_server_sdk/types/hook.rb +70 -0
  91. data/lib/vapi_server_sdk/types/hook_on.rb +9 -0
  92. data/lib/vapi_server_sdk/types/invite_user_dto.rb +11 -2
  93. data/lib/vapi_server_sdk/types/json_schema.rb +26 -2
  94. data/lib/vapi_server_sdk/types/{programmatic_edge_condition.rb → logic_edge_condition.rb} +13 -15
  95. data/lib/vapi_server_sdk/types/message_plan.rb +12 -2
  96. data/lib/vapi_server_sdk/types/open_ai_model.rb +1 -9
  97. data/lib/vapi_server_sdk/types/open_ai_model_fallback_models_item.rb +2 -0
  98. data/lib/vapi_server_sdk/types/open_ai_model_model.rb +2 -0
  99. data/lib/vapi_server_sdk/types/play_ht_voice_model.rb +1 -0
  100. data/lib/vapi_server_sdk/types/rime_ai_voice_id_enum.rb +22 -20
  101. data/lib/vapi_server_sdk/types/rime_ai_voice_model.rb +1 -0
  102. data/lib/vapi_server_sdk/types/say.rb +23 -14
  103. data/lib/vapi_server_sdk/types/say_hook.rb +81 -0
  104. data/lib/vapi_server_sdk/types/server.rb +17 -2
  105. data/lib/vapi_server_sdk/types/server_message_assistant_request.rb +12 -2
  106. data/lib/vapi_server_sdk/types/server_message_conversation_update.rb +12 -2
  107. data/lib/vapi_server_sdk/types/server_message_end_of_call_report.rb +11 -1
  108. data/lib/vapi_server_sdk/types/server_message_end_of_call_report_ended_reason.rb +10 -1
  109. data/lib/vapi_server_sdk/types/server_message_hang.rb +20 -2
  110. data/lib/vapi_server_sdk/types/server_message_knowledge_base_request.rb +14 -2
  111. data/lib/vapi_server_sdk/types/server_message_language_change_detected.rb +11 -1
  112. data/lib/vapi_server_sdk/types/server_message_message.rb +212 -237
  113. data/lib/vapi_server_sdk/types/server_message_model_output.rb +11 -1
  114. data/lib/vapi_server_sdk/types/server_message_phone_call_control.rb +18 -2
  115. data/lib/vapi_server_sdk/types/server_message_speech_update.rb +11 -1
  116. data/lib/vapi_server_sdk/types/server_message_status_update.rb +12 -2
  117. data/lib/vapi_server_sdk/types/server_message_status_update_ended_reason.rb +10 -1
  118. data/lib/vapi_server_sdk/types/server_message_tool_calls.rb +10 -2
  119. data/lib/vapi_server_sdk/types/server_message_transcript.rb +13 -2
  120. data/lib/vapi_server_sdk/types/server_message_transcript_type.rb +10 -0
  121. data/lib/vapi_server_sdk/types/server_message_transfer_destination_request.rb +12 -2
  122. data/lib/vapi_server_sdk/types/server_message_transfer_update.rb +11 -1
  123. data/lib/vapi_server_sdk/types/server_message_user_interrupted.rb +12 -2
  124. data/lib/vapi_server_sdk/types/server_message_voice_input.rb +11 -1
  125. data/lib/vapi_server_sdk/types/server_message_voice_request.rb +50 -2
  126. data/lib/vapi_server_sdk/types/stop_speaking_plan.rb +27 -2
  127. data/lib/vapi_server_sdk/types/subscription.rb +33 -5
  128. data/lib/vapi_server_sdk/types/sync_voice_library_dto_providers_item.rb +1 -0
  129. data/lib/vapi_server_sdk/types/test_suite.rb +104 -0
  130. data/lib/vapi_server_sdk/types/test_suite_run.rb +127 -0
  131. data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb +80 -0
  132. data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai_result.rb +9 -0
  133. data/lib/vapi_server_sdk/types/test_suite_run_status.rb +10 -0
  134. data/lib/vapi_server_sdk/types/test_suite_run_test_attempt.rb +75 -0
  135. data/lib/vapi_server_sdk/types/{analytics_query_dto.rb → test_suite_run_test_attempt_call.rb} +19 -17
  136. data/lib/vapi_server_sdk/types/test_suite_run_test_result.rb +75 -0
  137. data/lib/vapi_server_sdk/types/test_suite_runs_paginated_response.rb +75 -0
  138. data/lib/vapi_server_sdk/types/test_suite_test_scorer_ai.rb +65 -0
  139. data/lib/vapi_server_sdk/types/test_suite_test_voice.rb +132 -0
  140. data/lib/vapi_server_sdk/types/test_suite_tests_paginated_response.rb +75 -0
  141. data/lib/vapi_server_sdk/types/test_suites_paginated_response.rb +75 -0
  142. data/lib/vapi_server_sdk/types/time_range_step.rb +1 -0
  143. data/lib/vapi_server_sdk/types/tool_message_start.rb +18 -2
  144. data/lib/vapi_server_sdk/types/transfer.rb +74 -0
  145. data/lib/vapi_server_sdk/types/transfer_assistant_hook_action.rb +75 -0
  146. data/lib/vapi_server_sdk/types/{buy_phone_number_dto_fallback_destination.rb → transfer_assistant_hook_action_destination.rb} +9 -12
  147. data/lib/vapi_server_sdk/types/transfer_destination_assistant.rb +46 -0
  148. data/lib/vapi_server_sdk/types/transfer_plan.rb +37 -1
  149. data/lib/vapi_server_sdk/types/transfer_plan_mode.rb +4 -0
  150. data/lib/vapi_server_sdk/types/trieve_knowledge_base_search_plan.rb +12 -1
  151. data/lib/vapi_server_sdk/types/twilio_phone_number.rb +11 -2
  152. data/lib/vapi_server_sdk/types/twilio_phone_number_status.rb +10 -0
  153. data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_models_item.rb +1 -0
  154. data/lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb +90 -0
  155. data/lib/vapi_server_sdk/types/vapi_phone_number.rb +29 -4
  156. data/lib/vapi_server_sdk/types/vapi_phone_number_status.rb +10 -0
  157. data/lib/vapi_server_sdk/types/vonage_phone_number.rb +11 -2
  158. data/lib/vapi_server_sdk/types/vonage_phone_number_status.rb +10 -0
  159. data/lib/vapi_server_sdk/types/workflow.rb +1 -9
  160. data/lib/vapi_server_sdk/types/workflow_nodes_item.rb +104 -52
  161. data/lib/vapi_server_sdk/types/xai_model.rb +4 -3
  162. data/lib/vapi_server_sdk/types/xai_model_model.rb +10 -0
  163. data/lib/vapi_server_sdk.rb +21 -0
  164. metadata +61 -12
  165. data/lib/vapi_server_sdk/types/buy_phone_number_dto.rb +0 -147
  166. data/lib/vapi_server_sdk/types/org_with_org_user.rb +0 -262
  167. data/lib/vapi_server_sdk/types/org_with_org_user_channel.rb +0 -10
  168. data/lib/vapi_server_sdk/types/org_with_org_user_role.rb +0 -9
  169. data/lib/vapi_server_sdk/types/update_workflow_dto.rb +0 -82
  170. data/lib/vapi_server_sdk/types/update_workflow_dto_nodes_item.rb +0 -81
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vapi
7
+ class AssistantHookFilter
8
+ # @return [String] This is the type of filter - currently only "oneOf" is supported
9
+ attr_reader :type
10
+ # @return [String] This is the key to filter on (e.g. "call.endedReason")
11
+ attr_reader :key
12
+ # @return [Array<String>] This is the array of possible values to match against
13
+ attr_reader :one_of
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 type [String] This is the type of filter - currently only "oneOf" is supported
23
+ # @param key [String] This is the key to filter on (e.g. "call.endedReason")
24
+ # @param one_of [Array<String>] This is the array of possible values to match against
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vapi::AssistantHookFilter]
27
+ def initialize(type:, key:, one_of:, additional_properties: nil)
28
+ @type = type
29
+ @key = key
30
+ @one_of = one_of
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "key": key, "oneOf": one_of }
33
+ end
34
+
35
+ # Deserialize a JSON object to an instance of AssistantHookFilter
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Vapi::AssistantHookFilter]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ type = parsed_json["type"]
43
+ key = parsed_json["key"]
44
+ one_of = parsed_json["oneOf"]
45
+ new(
46
+ type: type,
47
+ key: key,
48
+ one_of: one_of,
49
+ additional_properties: struct
50
+ )
51
+ end
52
+
53
+ # Serialize an instance of AssistantHookFilter to a JSON object
54
+ #
55
+ # @return [String]
56
+ def to_json(*_args)
57
+ @_field_set&.to_json
58
+ end
59
+
60
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
61
+ # hash and check each fields type against the current object's property
62
+ # definitions.
63
+ #
64
+ # @param obj [Object]
65
+ # @return [Void]
66
+ def self.validate_raw(obj:)
67
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
68
+ obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
69
+ obj.one_of.is_a?(Array) != false || raise("Passed value for field obj.one_of is not the expected type, validation failed.")
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "assistant_hook_filter"
4
+ require_relative "assistant_hook_action_base"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Vapi
9
+ class AssistantHooks
10
+ # @return [String] This is the event that triggers this hook
11
+ attr_reader :on
12
+ # @return [Array<Vapi::AssistantHookFilter>] This is the set of filters that must match for the hook to trigger
13
+ attr_reader :filters
14
+ # @return [Array<Vapi::AssistantHookActionBase>] This is the set of actions to perform when the hook triggers
15
+ attr_reader :do_
16
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
17
+ attr_reader :additional_properties
18
+ # @return [Object]
19
+ attr_reader :_field_set
20
+ protected :_field_set
21
+
22
+ OMIT = Object.new
23
+
24
+ # @param on [String] This is the event that triggers this hook
25
+ # @param filters [Array<Vapi::AssistantHookFilter>] This is the set of filters that must match for the hook to trigger
26
+ # @param do_ [Array<Vapi::AssistantHookActionBase>] This is the set of actions to perform when the hook triggers
27
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
28
+ # @return [Vapi::AssistantHooks]
29
+ def initialize(on:, do_:, filters: OMIT, additional_properties: nil)
30
+ @on = on
31
+ @filters = filters if filters != OMIT
32
+ @do_ = do_
33
+ @additional_properties = additional_properties
34
+ @_field_set = { "on": on, "filters": filters, "do": do_ }.reject do |_k, v|
35
+ v == OMIT
36
+ end
37
+ end
38
+
39
+ # Deserialize a JSON object to an instance of AssistantHooks
40
+ #
41
+ # @param json_object [String]
42
+ # @return [Vapi::AssistantHooks]
43
+ def self.from_json(json_object:)
44
+ struct = JSON.parse(json_object, object_class: OpenStruct)
45
+ parsed_json = JSON.parse(json_object)
46
+ on = parsed_json["on"]
47
+ filters = parsed_json["filters"]&.map do |item|
48
+ item = item.to_json
49
+ Vapi::AssistantHookFilter.from_json(json_object: item)
50
+ end
51
+ do_ = parsed_json["do"]&.map do |item|
52
+ item = item.to_json
53
+ Vapi::AssistantHookActionBase.from_json(json_object: item)
54
+ end
55
+ new(
56
+ on: on,
57
+ filters: filters,
58
+ do_: do_,
59
+ additional_properties: struct
60
+ )
61
+ end
62
+
63
+ # Serialize an instance of AssistantHooks to a JSON object
64
+ #
65
+ # @return [String]
66
+ def to_json(*_args)
67
+ @_field_set&.to_json
68
+ end
69
+
70
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
71
+ # hash and check each fields type against the current object's property
72
+ # definitions.
73
+ #
74
+ # @param obj [Object]
75
+ # @return [Void]
76
+ def self.validate_raw(obj:)
77
+ obj.on.is_a?(String) != false || raise("Passed value for field obj.on is not the expected type, validation failed.")
78
+ obj.filters&.is_a?(Array) != false || raise("Passed value for field obj.filters is not the expected type, validation failed.")
79
+ obj.do_.is_a?(Array) != false || raise("Passed value for field obj.do_ is not the expected type, validation failed.")
80
+ end
81
+ end
82
+ end
@@ -10,6 +10,7 @@ require_relative "assistant_overrides_background_sound"
10
10
  require_relative "transport_configuration_twilio"
11
11
  require_relative "assistant_overrides_credentials_item"
12
12
  require_relative "twilio_voicemail_detection"
13
+ require_relative "compliance_plan"
13
14
  require_relative "analysis_plan"
14
15
  require_relative "artifact_plan"
15
16
  require_relative "message_plan"
@@ -17,6 +18,7 @@ require_relative "start_speaking_plan"
17
18
  require_relative "stop_speaking_plan"
18
19
  require_relative "monitor_plan"
19
20
  require_relative "server"
21
+ require_relative "assistant_hooks"
20
22
  require "ostruct"
21
23
  require "json"
22
24
 
@@ -44,10 +46,6 @@ module Vapi
44
46
  # transfer points).
45
47
  # @default 'assistant-speaks-first'
46
48
  attr_reader :first_message_mode
47
- # @return [Boolean] When this is enabled, no logs, recordings, or transcriptions will be stored. At
48
- # the end of the call, you will still receive an end-of-call-report message to
49
- # store on your server. Defaults to false.
50
- attr_reader :hipaa_enabled
51
49
  # @return [Array<Vapi::AssistantOverridesClientMessagesItem>] These are the messages that will be sent to your Client SDKs. Default is
52
50
  # tatus-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input.
53
51
  # You can check the shape of the messages in ClientMessage schema.
@@ -116,6 +114,8 @@ module Vapi
116
114
  # @return [Array<String>] This list contains phrases that, if spoken by the assistant, will trigger the
117
115
  # call to be hung up. Case insensitive.
118
116
  attr_reader :end_call_phrases
117
+ # @return [Vapi::CompliancePlan]
118
+ attr_reader :compliance_plan
119
119
  # @return [Hash{String => Object}] This is for metadata you want to store on the assistant.
120
120
  attr_reader :metadata
121
121
  # @return [Vapi::AnalysisPlan] This is the plan for analysis of assistant's calls. Stored in `call.analysis`.
@@ -170,6 +170,8 @@ module Vapi
170
170
  # 2. phoneNumber.serverUrl
171
171
  # 3. org.serverUrl
172
172
  attr_reader :server
173
+ # @return [Array<Vapi::AssistantHooks>] This is a set of actions that will be performed on certain events.
174
+ attr_reader :hooks
173
175
  # @return [OpenStruct] Additional properties unmapped to the current class definition
174
176
  attr_reader :additional_properties
175
177
  # @return [Object]
@@ -195,9 +197,6 @@ module Vapi
195
197
  # state. (`assistant.model.messages` at call start, `call.messages` at squad
196
198
  # transfer points).
197
199
  # @default 'assistant-speaks-first'
198
- # @param hipaa_enabled [Boolean] When this is enabled, no logs, recordings, or transcriptions will be stored. At
199
- # the end of the call, you will still receive an end-of-call-report message to
200
- # store on your server. Defaults to false.
201
200
  # @param client_messages [Array<Vapi::AssistantOverridesClientMessagesItem>] These are the messages that will be sent to your Client SDKs. Default is
202
201
  # tatus-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input.
203
202
  # You can check the shape of the messages in ClientMessage schema.
@@ -251,6 +250,7 @@ module Vapi
251
250
  # If unspecified, it will hang up without saying anything.
252
251
  # @param end_call_phrases [Array<String>] This list contains phrases that, if spoken by the assistant, will trigger the
253
252
  # call to be hung up. Case insensitive.
253
+ # @param compliance_plan [Vapi::CompliancePlan]
254
254
  # @param metadata [Hash{String => Object}] This is for metadata you want to store on the assistant.
255
255
  # @param analysis_plan [Vapi::AnalysisPlan] This is the plan for analysis of assistant's calls. Stored in `call.analysis`.
256
256
  # @param artifact_plan [Vapi::ArtifactPlan] This is the plan for artifacts generated during assistant's calls. Stored in
@@ -296,16 +296,16 @@ module Vapi
296
296
  # 1. assistant.server.url
297
297
  # 2. phoneNumber.serverUrl
298
298
  # 3. org.serverUrl
299
+ # @param hooks [Array<Vapi::AssistantHooks>] This is a set of actions that will be performed on certain events.
299
300
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
300
301
  # @return [Vapi::AssistantOverrides]
301
302
  def initialize(transcriber: OMIT, model: OMIT, voice: OMIT, first_message: OMIT, first_message_mode: OMIT,
302
- hipaa_enabled: OMIT, client_messages: OMIT, server_messages: OMIT, silence_timeout_seconds: OMIT, max_duration_seconds: OMIT, background_sound: OMIT, background_denoising_enabled: OMIT, model_output_in_messages_enabled: OMIT, transport_configurations: OMIT, credentials: OMIT, variable_values: OMIT, name: OMIT, voicemail_detection: OMIT, voicemail_message: OMIT, end_call_message: OMIT, end_call_phrases: OMIT, metadata: OMIT, analysis_plan: OMIT, artifact_plan: OMIT, message_plan: OMIT, start_speaking_plan: OMIT, stop_speaking_plan: OMIT, monitor_plan: OMIT, credential_ids: OMIT, server: OMIT, additional_properties: nil)
303
+ client_messages: OMIT, server_messages: OMIT, silence_timeout_seconds: OMIT, max_duration_seconds: OMIT, background_sound: OMIT, background_denoising_enabled: OMIT, model_output_in_messages_enabled: OMIT, transport_configurations: OMIT, credentials: OMIT, variable_values: OMIT, name: OMIT, voicemail_detection: OMIT, voicemail_message: OMIT, end_call_message: OMIT, end_call_phrases: OMIT, compliance_plan: OMIT, metadata: OMIT, analysis_plan: OMIT, artifact_plan: OMIT, message_plan: OMIT, start_speaking_plan: OMIT, stop_speaking_plan: OMIT, monitor_plan: OMIT, credential_ids: OMIT, server: OMIT, hooks: OMIT, additional_properties: nil)
303
304
  @transcriber = transcriber if transcriber != OMIT
304
305
  @model = model if model != OMIT
305
306
  @voice = voice if voice != OMIT
306
307
  @first_message = first_message if first_message != OMIT
307
308
  @first_message_mode = first_message_mode if first_message_mode != OMIT
308
- @hipaa_enabled = hipaa_enabled if hipaa_enabled != OMIT
309
309
  @client_messages = client_messages if client_messages != OMIT
310
310
  @server_messages = server_messages if server_messages != OMIT
311
311
  @silence_timeout_seconds = silence_timeout_seconds if silence_timeout_seconds != OMIT
@@ -321,6 +321,7 @@ module Vapi
321
321
  @voicemail_message = voicemail_message if voicemail_message != OMIT
322
322
  @end_call_message = end_call_message if end_call_message != OMIT
323
323
  @end_call_phrases = end_call_phrases if end_call_phrases != OMIT
324
+ @compliance_plan = compliance_plan if compliance_plan != OMIT
324
325
  @metadata = metadata if metadata != OMIT
325
326
  @analysis_plan = analysis_plan if analysis_plan != OMIT
326
327
  @artifact_plan = artifact_plan if artifact_plan != OMIT
@@ -330,6 +331,7 @@ module Vapi
330
331
  @monitor_plan = monitor_plan if monitor_plan != OMIT
331
332
  @credential_ids = credential_ids if credential_ids != OMIT
332
333
  @server = server if server != OMIT
334
+ @hooks = hooks if hooks != OMIT
333
335
  @additional_properties = additional_properties
334
336
  @_field_set = {
335
337
  "transcriber": transcriber,
@@ -337,7 +339,6 @@ module Vapi
337
339
  "voice": voice,
338
340
  "firstMessage": first_message,
339
341
  "firstMessageMode": first_message_mode,
340
- "hipaaEnabled": hipaa_enabled,
341
342
  "clientMessages": client_messages,
342
343
  "serverMessages": server_messages,
343
344
  "silenceTimeoutSeconds": silence_timeout_seconds,
@@ -353,6 +354,7 @@ module Vapi
353
354
  "voicemailMessage": voicemail_message,
354
355
  "endCallMessage": end_call_message,
355
356
  "endCallPhrases": end_call_phrases,
357
+ "compliancePlan": compliance_plan,
356
358
  "metadata": metadata,
357
359
  "analysisPlan": analysis_plan,
358
360
  "artifactPlan": artifact_plan,
@@ -361,7 +363,8 @@ module Vapi
361
363
  "stopSpeakingPlan": stop_speaking_plan,
362
364
  "monitorPlan": monitor_plan,
363
365
  "credentialIds": credential_ids,
364
- "server": server
366
+ "server": server,
367
+ "hooks": hooks
365
368
  }.reject do |_k, v|
366
369
  v == OMIT
367
370
  end
@@ -394,7 +397,6 @@ module Vapi
394
397
  end
395
398
  first_message = parsed_json["firstMessage"]
396
399
  first_message_mode = parsed_json["firstMessageMode"]
397
- hipaa_enabled = parsed_json["hipaaEnabled"]
398
400
  client_messages = parsed_json["clientMessages"]
399
401
  server_messages = parsed_json["serverMessages"]
400
402
  silence_timeout_seconds = parsed_json["silenceTimeoutSeconds"]
@@ -421,6 +423,12 @@ module Vapi
421
423
  voicemail_message = parsed_json["voicemailMessage"]
422
424
  end_call_message = parsed_json["endCallMessage"]
423
425
  end_call_phrases = parsed_json["endCallPhrases"]
426
+ if parsed_json["compliancePlan"].nil?
427
+ compliance_plan = nil
428
+ else
429
+ compliance_plan = parsed_json["compliancePlan"].to_json
430
+ compliance_plan = Vapi::CompliancePlan.from_json(json_object: compliance_plan)
431
+ end
424
432
  metadata = parsed_json["metadata"]
425
433
  if parsed_json["analysisPlan"].nil?
426
434
  analysis_plan = nil
@@ -465,13 +473,16 @@ module Vapi
465
473
  server = parsed_json["server"].to_json
466
474
  server = Vapi::Server.from_json(json_object: server)
467
475
  end
476
+ hooks = parsed_json["hooks"]&.map do |item|
477
+ item = item.to_json
478
+ Vapi::AssistantHooks.from_json(json_object: item)
479
+ end
468
480
  new(
469
481
  transcriber: transcriber,
470
482
  model: model,
471
483
  voice: voice,
472
484
  first_message: first_message,
473
485
  first_message_mode: first_message_mode,
474
- hipaa_enabled: hipaa_enabled,
475
486
  client_messages: client_messages,
476
487
  server_messages: server_messages,
477
488
  silence_timeout_seconds: silence_timeout_seconds,
@@ -487,6 +498,7 @@ module Vapi
487
498
  voicemail_message: voicemail_message,
488
499
  end_call_message: end_call_message,
489
500
  end_call_phrases: end_call_phrases,
501
+ compliance_plan: compliance_plan,
490
502
  metadata: metadata,
491
503
  analysis_plan: analysis_plan,
492
504
  artifact_plan: artifact_plan,
@@ -496,6 +508,7 @@ module Vapi
496
508
  monitor_plan: monitor_plan,
497
509
  credential_ids: credential_ids,
498
510
  server: server,
511
+ hooks: hooks,
499
512
  additional_properties: struct
500
513
  )
501
514
  end
@@ -519,7 +532,6 @@ module Vapi
519
532
  obj.voice.nil? || Vapi::AssistantOverridesVoice.validate_raw(obj: obj.voice)
520
533
  obj.first_message&.is_a?(String) != false || raise("Passed value for field obj.first_message is not the expected type, validation failed.")
521
534
  obj.first_message_mode&.is_a?(Vapi::AssistantOverridesFirstMessageMode) != false || raise("Passed value for field obj.first_message_mode is not the expected type, validation failed.")
522
- obj.hipaa_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.hipaa_enabled is not the expected type, validation failed.")
523
535
  obj.client_messages&.is_a?(Array) != false || raise("Passed value for field obj.client_messages is not the expected type, validation failed.")
524
536
  obj.server_messages&.is_a?(Array) != false || raise("Passed value for field obj.server_messages is not the expected type, validation failed.")
525
537
  obj.silence_timeout_seconds&.is_a?(Float) != false || raise("Passed value for field obj.silence_timeout_seconds is not the expected type, validation failed.")
@@ -535,6 +547,7 @@ module Vapi
535
547
  obj.voicemail_message&.is_a?(String) != false || raise("Passed value for field obj.voicemail_message is not the expected type, validation failed.")
536
548
  obj.end_call_message&.is_a?(String) != false || raise("Passed value for field obj.end_call_message is not the expected type, validation failed.")
537
549
  obj.end_call_phrases&.is_a?(Array) != false || raise("Passed value for field obj.end_call_phrases is not the expected type, validation failed.")
550
+ obj.compliance_plan.nil? || Vapi::CompliancePlan.validate_raw(obj: obj.compliance_plan)
538
551
  obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
539
552
  obj.analysis_plan.nil? || Vapi::AnalysisPlan.validate_raw(obj: obj.analysis_plan)
540
553
  obj.artifact_plan.nil? || Vapi::ArtifactPlan.validate_raw(obj: obj.artifact_plan)
@@ -544,6 +557,7 @@ module Vapi
544
557
  obj.monitor_plan.nil? || Vapi::MonitorPlan.validate_raw(obj: obj.monitor_plan)
545
558
  obj.credential_ids&.is_a?(Array) != false || raise("Passed value for field obj.credential_ids is not the expected type, validation failed.")
546
559
  obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server)
560
+ obj.hooks&.is_a?(Array) != false || raise("Passed value for field obj.hooks is not the expected type, validation failed.")
547
561
  end
548
562
  end
549
563
  end
@@ -13,6 +13,7 @@ module Vapi
13
13
  SPEECH_UPDATE = "speech-update"
14
14
  STATUS_UPDATE = "status-update"
15
15
  TRANSCRIPT = "transcript"
16
+ TRANSCRIPT_TRANSCRIPT_TYPE_FINAL = "transcript[transcriptType='final']"
16
17
  TOOL_CALLS = "tool-calls"
17
18
  TRANSFER_DESTINATION_REQUEST = "transfer-destination-request"
18
19
  TRANSFER_UPDATE = "transfer-update"
@@ -13,6 +13,7 @@ module Vapi
13
13
  SPEECH_UPDATE = "speech-update"
14
14
  STATUS_UPDATE = "status-update"
15
15
  TRANSCRIPT = "transcript"
16
+ TRANSCRIPT_TRANSCRIPT_TYPE_FINAL = "transcript[transcriptType='final']"
16
17
  TOOL_CALLS = "tool-calls"
17
18
  TRANSFER_DESTINATION_REQUEST = "transfer-destination-request"
18
19
  TRANSFER_UPDATE = "transfer-update"
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Vapi
4
4
  class AzureOpenAiCredentialModelsItem
5
+ GPT_4_O_20240806_PTU = "gpt-4o-2024-08-06-ptu"
5
6
  GPT_4_O_20240806 = "gpt-4o-2024-08-06"
6
7
  GPT_4_O_MINI_20240718 = "gpt-4o-mini-2024-07-18"
7
8
  GPT_4_O_20240513 = "gpt-4o-2024-05-13"
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vapi
7
+ class BackoffPlan
8
+ # @return [Float] This is the maximum number of retries to attempt if the request fails. Defaults
9
+ # to 0 (no retries).
10
+ # @default 0
11
+ attr_reader :max_retries
12
+ # @return [Hash{String => Object}] This is the type of backoff plan to use. Defaults to fixed.
13
+ # @default fixed
14
+ attr_reader :type
15
+ # @return [Float] This is the base delay in seconds. For linear backoff, this is the delay between
16
+ # each retry. For exponential backoff, this is the initial delay.
17
+ attr_reader :base_delay_seconds
18
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
19
+ attr_reader :additional_properties
20
+ # @return [Object]
21
+ attr_reader :_field_set
22
+ protected :_field_set
23
+
24
+ OMIT = Object.new
25
+
26
+ # @param max_retries [Float] This is the maximum number of retries to attempt if the request fails. Defaults
27
+ # to 0 (no retries).
28
+ # @default 0
29
+ # @param type [Hash{String => Object}] This is the type of backoff plan to use. Defaults to fixed.
30
+ # @default fixed
31
+ # @param base_delay_seconds [Float] This is the base delay in seconds. For linear backoff, this is the delay between
32
+ # each retry. For exponential backoff, this is the initial delay.
33
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
34
+ # @return [Vapi::BackoffPlan]
35
+ def initialize(max_retries:, type:, base_delay_seconds:, additional_properties: nil)
36
+ @max_retries = max_retries
37
+ @type = type
38
+ @base_delay_seconds = base_delay_seconds
39
+ @additional_properties = additional_properties
40
+ @_field_set = { "maxRetries": max_retries, "type": type, "baseDelaySeconds": base_delay_seconds }
41
+ end
42
+
43
+ # Deserialize a JSON object to an instance of BackoffPlan
44
+ #
45
+ # @param json_object [String]
46
+ # @return [Vapi::BackoffPlan]
47
+ def self.from_json(json_object:)
48
+ struct = JSON.parse(json_object, object_class: OpenStruct)
49
+ parsed_json = JSON.parse(json_object)
50
+ max_retries = parsed_json["maxRetries"]
51
+ type = parsed_json["type"]
52
+ base_delay_seconds = parsed_json["baseDelaySeconds"]
53
+ new(
54
+ max_retries: max_retries,
55
+ type: type,
56
+ base_delay_seconds: base_delay_seconds,
57
+ additional_properties: struct
58
+ )
59
+ end
60
+
61
+ # Serialize an instance of BackoffPlan to a JSON object
62
+ #
63
+ # @return [String]
64
+ def to_json(*_args)
65
+ @_field_set&.to_json
66
+ end
67
+
68
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
69
+ # hash and check each fields type against the current object's property
70
+ # definitions.
71
+ #
72
+ # @param obj [Object]
73
+ # @return [Void]
74
+ def self.validate_raw(obj:)
75
+ obj.max_retries.is_a?(Float) != false || raise("Passed value for field obj.max_retries is not the expected type, validation failed.")
76
+ obj.type.is_a?(Hash) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
77
+ obj.base_delay_seconds.is_a?(Float) != false || raise("Passed value for field obj.base_delay_seconds is not the expected type, validation failed.")
78
+ end
79
+ end
80
+ end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "byo_phone_number_fallback_destination"
4
4
  require "date"
5
+ require_relative "byo_phone_number_status"
5
6
  require_relative "server"
6
7
  require "ostruct"
7
8
  require "json"
@@ -34,6 +35,8 @@ module Vapi
34
35
  attr_reader :created_at
35
36
  # @return [DateTime] This is the ISO 8601 date-time string of when the phone number was last updated.
36
37
  attr_reader :updated_at
38
+ # @return [Vapi::ByoPhoneNumberStatus] This is the status of the phone number.
39
+ attr_reader :status
37
40
  # @return [String] This is the name of the phone number. This is just for your own reference.
38
41
  attr_reader :name
39
42
  # @return [String] This is the assistant that will be used for incoming calls to this phone number.
@@ -88,6 +91,7 @@ module Vapi
88
91
  # @param org_id [String] This is the unique identifier for the org that this phone number belongs to.
89
92
  # @param created_at [DateTime] This is the ISO 8601 date-time string of when the phone number was created.
90
93
  # @param updated_at [DateTime] This is the ISO 8601 date-time string of when the phone number was last updated.
94
+ # @param status [Vapi::ByoPhoneNumberStatus] This is the status of the phone number.
91
95
  # @param name [String] This is the name of the phone number. This is just for your own reference.
92
96
  # @param assistant_id [String] This is the assistant that will be used for incoming calls to this phone number.
93
97
  # If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
@@ -111,13 +115,14 @@ module Vapi
111
115
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
112
116
  # @return [Vapi::ByoPhoneNumber]
113
117
  def initialize(id:, org_id:, created_at:, updated_at:, credential_id:, fallback_destination: OMIT,
114
- number_e_164_check_enabled: OMIT, name: OMIT, assistant_id: OMIT, squad_id: OMIT, server: OMIT, number: OMIT, additional_properties: nil)
118
+ number_e_164_check_enabled: OMIT, status: OMIT, name: OMIT, assistant_id: OMIT, squad_id: OMIT, server: OMIT, number: OMIT, additional_properties: nil)
115
119
  @fallback_destination = fallback_destination if fallback_destination != OMIT
116
120
  @number_e_164_check_enabled = number_e_164_check_enabled if number_e_164_check_enabled != OMIT
117
121
  @id = id
118
122
  @org_id = org_id
119
123
  @created_at = created_at
120
124
  @updated_at = updated_at
125
+ @status = status if status != OMIT
121
126
  @name = name if name != OMIT
122
127
  @assistant_id = assistant_id if assistant_id != OMIT
123
128
  @squad_id = squad_id if squad_id != OMIT
@@ -132,6 +137,7 @@ module Vapi
132
137
  "orgId": org_id,
133
138
  "createdAt": created_at,
134
139
  "updatedAt": updated_at,
140
+ "status": status,
135
141
  "name": name,
136
142
  "assistantId": assistant_id,
137
143
  "squadId": squad_id,
@@ -161,6 +167,7 @@ module Vapi
161
167
  org_id = parsed_json["orgId"]
162
168
  created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
163
169
  updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
170
+ status = parsed_json["status"]
164
171
  name = parsed_json["name"]
165
172
  assistant_id = parsed_json["assistantId"]
166
173
  squad_id = parsed_json["squadId"]
@@ -179,6 +186,7 @@ module Vapi
179
186
  org_id: org_id,
180
187
  created_at: created_at,
181
188
  updated_at: updated_at,
189
+ status: status,
182
190
  name: name,
183
191
  assistant_id: assistant_id,
184
192
  squad_id: squad_id,
@@ -209,6 +217,7 @@ module Vapi
209
217
  obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
210
218
  obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
211
219
  obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
220
+ obj.status&.is_a?(Vapi::ByoPhoneNumberStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
212
221
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
213
222
  obj.assistant_id&.is_a?(String) != false || raise("Passed value for field obj.assistant_id is not the expected type, validation failed.")
214
223
  obj.squad_id&.is_a?(String) != false || raise("Passed value for field obj.squad_id is not the expected type, validation failed.")
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vapi
4
+ # This is the status of the phone number.
5
+ class ByoPhoneNumberStatus
6
+ ACTIVE = "active"
7
+ ACTIVATING = "activating"
8
+ BLOCKED = "blocked"
9
+ end
10
+ end
@@ -3,7 +3,7 @@
3
3
  module Vapi
4
4
  # This is the explanation for how the call ended.
5
5
  class CallEndedReason
6
- ASSISTANT_NOT_INVALID = "assistant-not-invalid"
6
+ ASSISTANT_NOT_VALID = "assistant-not-valid"
7
7
  ASSISTANT_NOT_PROVIDED = "assistant-not-provided"
8
8
  CALL_START_ERROR_NEITHER_ASSISTANT_NOR_SERVER_SET = "call-start-error-neither-assistant-nor-server-set"
9
9
  ASSISTANT_REQUEST_FAILED = "assistant-request-failed"
@@ -14,6 +14,7 @@ module Vapi
14
14
  ASSISTANT_REQUEST_RETURNED_FORWARDING_PHONE_NUMBER = "assistant-request-returned-forwarding-phone-number"
15
15
  ASSISTANT_ENDED_CALL = "assistant-ended-call"
16
16
  ASSISTANT_SAID_END_CALL_PHRASE = "assistant-said-end-call-phrase"
17
+ ASSISTANT_ENDED_CALL_WITH_HANGUP_TASK = "assistant-ended-call-with-hangup-task"
17
18
  ASSISTANT_FORWARDED_CALL = "assistant-forwarded-call"
18
19
  ASSISTANT_JOIN_TIMED_OUT = "assistant-join-timed-out"
19
20
  CUSTOMER_BUSY = "customer-busy"
@@ -37,8 +38,10 @@ module Vapi
37
38
  PIPELINE_ERROR_RIME_AI_VOICE_FAILED = "pipeline-error-rime-ai-voice-failed"
38
39
  PIPELINE_ERROR_NEETS_VOICE_FAILED = "pipeline-error-neets-voice-failed"
39
40
  PIPELINE_ERROR_SMALLEST_AI_VOICE_FAILED = "pipeline-error-smallest-ai-voice-failed"
41
+ PIPELINE_ERROR_NEUPHONIC_VOICE_FAILED = "pipeline-error-neuphonic-voice-failed"
40
42
  PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED = "pipeline-error-deepgram-transcriber-failed"
41
43
  PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED = "pipeline-error-gladia-transcriber-failed"
44
+ PIPELINE_ERROR_SPEECHMATICS_TRANSCRIBER_FAILED = "pipeline-error-speechmatics-transcriber-failed"
42
45
  PIPELINE_ERROR_ASSEMBLY_AI_TRANSCRIBER_FAILED = "pipeline-error-assembly-ai-transcriber-failed"
43
46
  PIPELINE_ERROR_TALKSCRIBER_TRANSCRIBER_FAILED = "pipeline-error-talkscriber-transcriber-failed"
44
47
  PIPELINE_ERROR_AZURE_SPEECH_TRANSCRIBER_FAILED = "pipeline-error-azure-speech-transcriber-failed"
@@ -66,6 +69,7 @@ module Vapi
66
69
  PIPELINE_ERROR_GROQ_LLM_FAILED = "pipeline-error-groq-llm-failed"
67
70
  PIPELINE_ERROR_GOOGLE_LLM_FAILED = "pipeline-error-google-llm-failed"
68
71
  PIPELINE_ERROR_XAI_LLM_FAILED = "pipeline-error-xai-llm-failed"
72
+ PIPELINE_ERROR_MISTRAL_LLM_FAILED = "pipeline-error-mistral-llm-failed"
69
73
  PIPELINE_ERROR_INFLECTION_AI_LLM_FAILED = "pipeline-error-inflection-ai-llm-failed"
70
74
  PIPELINE_ERROR_CEREBRAS_LLM_FAILED = "pipeline-error-cerebras-llm-failed"
71
75
  PIPELINE_ERROR_DEEP_SEEK_LLM_FAILED = "pipeline-error-deep-seek-llm-failed"
@@ -84,6 +88,11 @@ module Vapi
84
88
  PIPELINE_ERROR_XAI_403_MODEL_ACCESS_DENIED = "pipeline-error-xai-403-model-access-denied"
85
89
  PIPELINE_ERROR_XAI_429_EXCEEDED_QUOTA = "pipeline-error-xai-429-exceeded-quota"
86
90
  PIPELINE_ERROR_XAI_500_SERVER_ERROR = "pipeline-error-xai-500-server-error"
91
+ PIPELINE_ERROR_MISTRAL_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-mistral-400-bad-request-validation-failed"
92
+ PIPELINE_ERROR_MISTRAL_401_UNAUTHORIZED = "pipeline-error-mistral-401-unauthorized"
93
+ PIPELINE_ERROR_MISTRAL_403_MODEL_ACCESS_DENIED = "pipeline-error-mistral-403-model-access-denied"
94
+ PIPELINE_ERROR_MISTRAL_429_EXCEEDED_QUOTA = "pipeline-error-mistral-429-exceeded-quota"
95
+ PIPELINE_ERROR_MISTRAL_500_SERVER_ERROR = "pipeline-error-mistral-500-server-error"
87
96
  PIPELINE_ERROR_INFLECTION_AI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-inflection-ai-400-bad-request-validation-failed"
88
97
  PIPELINE_ERROR_INFLECTION_AI_401_UNAUTHORIZED = "pipeline-error-inflection-ai-401-unauthorized"
89
98
  PIPELINE_ERROR_INFLECTION_AI_403_MODEL_ACCESS_DENIED = "pipeline-error-inflection-ai-403-model-access-denied"
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "cartesia_experimental_controls_speed"
4
+ require_relative "cartesia_experimental_controls_emotion"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Vapi
9
+ class CartesiaExperimentalControls
10
+ # @return [Vapi::CartesiaExperimentalControlsSpeed]
11
+ attr_reader :speed
12
+ # @return [Vapi::CartesiaExperimentalControlsEmotion]
13
+ attr_reader :emotion
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 speed [Vapi::CartesiaExperimentalControlsSpeed]
23
+ # @param emotion [Vapi::CartesiaExperimentalControlsEmotion]
24
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
+ # @return [Vapi::CartesiaExperimentalControls]
26
+ def initialize(speed: OMIT, emotion: OMIT, additional_properties: nil)
27
+ @speed = speed if speed != OMIT
28
+ @emotion = emotion if emotion != OMIT
29
+ @additional_properties = additional_properties
30
+ @_field_set = { "speed": speed, "emotion": emotion }.reject do |_k, v|
31
+ v == OMIT
32
+ end
33
+ end
34
+
35
+ # Deserialize a JSON object to an instance of CartesiaExperimentalControls
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Vapi::CartesiaExperimentalControls]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ speed = parsed_json["speed"]
43
+ emotion = parsed_json["emotion"]
44
+ new(
45
+ speed: speed,
46
+ emotion: emotion,
47
+ additional_properties: struct
48
+ )
49
+ end
50
+
51
+ # Serialize an instance of CartesiaExperimentalControls to a JSON object
52
+ #
53
+ # @return [String]
54
+ def to_json(*_args)
55
+ @_field_set&.to_json
56
+ end
57
+
58
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
59
+ # hash and check each fields type against the current object's property
60
+ # definitions.
61
+ #
62
+ # @param obj [Object]
63
+ # @return [Void]
64
+ def self.validate_raw(obj:)
65
+ obj.speed&.is_a?(Vapi::CartesiaExperimentalControlsSpeed) != false || raise("Passed value for field obj.speed is not the expected type, validation failed.")
66
+ obj.emotion&.is_a?(Vapi::CartesiaExperimentalControlsEmotion) != false || raise("Passed value for field obj.emotion is not the expected type, validation failed.")
67
+ end
68
+ end
69
+ end