vapi_server_sdk 0.3.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 +83 -12
- data/lib/vapi_server_sdk/analytics/client.rb +41 -26
- data/lib/vapi_server_sdk/assistants/client.rb +84 -84
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/blocks/client.rb +0 -70
- data/lib/vapi_server_sdk/calls/client.rb +110 -76
- data/lib/vapi_server_sdk/files/client.rb +0 -70
- data/lib/vapi_server_sdk/knowledge_bases/client.rb +0 -70
- data/lib/vapi_server_sdk/logs/client.rb +15 -46
- data/lib/vapi_server_sdk/logs/types/logging_controller_logs_delete_query_request_type.rb +12 -0
- data/lib/vapi_server_sdk/phone_numbers/client.rb +0 -70
- data/lib/vapi_server_sdk/squads/client.rb +136 -78
- 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/tools/client.rb +0 -70
- data/lib/vapi_server_sdk/types/ai_edge_condition.rb +55 -0
- 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_credential_region.rb +4 -2
- data/lib/vapi_server_sdk/types/azure_open_ai_credential_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/azure_open_ai_credential_region.rb +4 -2
- data/lib/vapi_server_sdk/types/backoff_plan.rb +80 -0
- data/lib/vapi_server_sdk/types/bash_tool_with_tool_call.rb +175 -0
- data/lib/vapi_server_sdk/types/bash_tool_with_tool_call_messages_item.rb +120 -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_end_call.rb +47 -0
- data/lib/vapi_server_sdk/types/client_inbound_message_message.rb +13 -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_tool_calls_tool_with_tool_call_list_item.rb +116 -77
- 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/computer_tool_with_tool_call.rb +199 -0
- data/lib/vapi_server_sdk/types/computer_tool_with_tool_call_messages_item.rb +120 -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_credential_dto_region.rb +4 -2
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_region.rb +4 -2
- data/lib/vapi_server_sdk/types/create_custom_knowledge_base_dto.rb +2 -4
- data/lib/vapi_server_sdk/types/create_test_suite_test_voice_dto.rb +90 -0
- data/lib/vapi_server_sdk/types/create_trieve_knowledge_base_dto.rb +34 -47
- data/lib/vapi_server_sdk/types/create_trieve_knowledge_base_dto_create_plan.rb +97 -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 +80 -0
- data/lib/vapi_server_sdk/types/create_workflow_dto_nodes_item.rb +133 -0
- data/lib/vapi_server_sdk/types/custom_knowledge_base.rb +2 -4
- 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 +87 -0
- data/lib/vapi_server_sdk/types/edge_condition.rb +107 -0
- 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/function_tool_with_tool_call.rb +1 -10
- data/lib/vapi_server_sdk/types/gather.rb +143 -0
- data/lib/vapi_server_sdk/types/ghl_tool_with_tool_call.rb +1 -9
- 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 +37 -2
- data/lib/vapi_server_sdk/types/log.rb +18 -18
- data/lib/vapi_server_sdk/types/logic_edge_condition.rb +55 -0
- data/lib/vapi_server_sdk/types/make_tool_with_tool_call.rb +1 -9
- 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 +81 -0
- 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_tool_calls_tool_with_tool_call_list_item.rb +116 -77
- 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 +44 -14
- 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/text_editor_tool_with_tool_call.rb +175 -0
- data/lib/vapi_server_sdk/types/text_editor_tool_with_tool_call_messages_item.rb +121 -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.rb +35 -44
- data/lib/vapi_server_sdk/types/{trieve_knowledge_base_vector_store_create_plan.rb → trieve_knowledge_base_chunk_plan.rb} +17 -11
- data/lib/vapi_server_sdk/types/trieve_knowledge_base_create.rb +59 -0
- data/lib/vapi_server_sdk/types/trieve_knowledge_base_create_plan.rb +96 -0
- data/lib/vapi_server_sdk/types/trieve_knowledge_base_import.rb +55 -0
- data/lib/vapi_server_sdk/types/{trieve_knowledge_base_vector_store_search_plan.rb → trieve_knowledge_base_search_plan.rb} +21 -12
- data/lib/vapi_server_sdk/types/{trieve_knowledge_base_vector_store_search_plan_search_type.rb → trieve_knowledge_base_search_plan_search_type.rb} +1 -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_credential_dto_region.rb +4 -2
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_region.rb +4 -2
- data/lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb +2 -4
- data/lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb +90 -0
- data/lib/vapi_server_sdk/types/update_trieve_knowledge_base_dto.rb +34 -47
- data/lib/vapi_server_sdk/types/update_trieve_knowledge_base_dto_create_plan.rb +97 -0
- data/lib/vapi_server_sdk/types/vapi_model.rb +27 -1
- 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 +117 -0
- data/lib/vapi_server_sdk/types/workflow_nodes_item.rb +133 -0
- 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 +85 -11
- 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
@@ -20,6 +20,9 @@ module Vapi
|
|
20
20
|
# - `call.phoneNumber`,
|
21
21
|
# - `call.phoneNumberId`.
|
22
22
|
attr_reader :phone_number
|
23
|
+
# @return [String] This is the type of the message. "status-update" is sent whenever the
|
24
|
+
# `call.status` changes.
|
25
|
+
attr_reader :type
|
23
26
|
# @return [Vapi::ServerMessageStatusUpdateStatus] This is the status of the call.
|
24
27
|
attr_reader :status
|
25
28
|
# @return [Vapi::ServerMessageStatusUpdateEndedReason] This is the reason the call ended. This is only sent if the status is "ended".
|
@@ -80,6 +83,8 @@ module Vapi
|
|
80
83
|
# This matches one of the following:
|
81
84
|
# - `call.phoneNumber`,
|
82
85
|
# - `call.phoneNumberId`.
|
86
|
+
# @param type [String] This is the type of the message. "status-update" is sent whenever the
|
87
|
+
# `call.status` changes.
|
83
88
|
# @param status [Vapi::ServerMessageStatusUpdateStatus] This is the status of the call.
|
84
89
|
# @param ended_reason [Vapi::ServerMessageStatusUpdateEndedReason] This is the reason the call ended. This is only sent if the status is "ended".
|
85
90
|
# @param messages [Array<Vapi::ServerMessageStatusUpdateMessagesItem>] These are the conversation messages of the call. This is only sent if the status
|
@@ -117,9 +122,10 @@ module Vapi
|
|
117
122
|
# This will include any errors related to the "assistant-request" if one was made.
|
118
123
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
119
124
|
# @return [Vapi::ServerMessageStatusUpdate]
|
120
|
-
def initialize(status:, phone_number: OMIT, ended_reason: OMIT, messages: OMIT,
|
121
|
-
destination: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT, call: OMIT, transcript: OMIT, summary: OMIT, inbound_phone_call_debugging_artifacts: OMIT, additional_properties: nil)
|
125
|
+
def initialize(type:, status:, phone_number: OMIT, ended_reason: OMIT, messages: OMIT,
|
126
|
+
messages_open_ai_formatted: OMIT, destination: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT, call: OMIT, transcript: OMIT, summary: OMIT, inbound_phone_call_debugging_artifacts: OMIT, additional_properties: nil)
|
122
127
|
@phone_number = phone_number if phone_number != OMIT
|
128
|
+
@type = type
|
123
129
|
@status = status
|
124
130
|
@ended_reason = ended_reason if ended_reason != OMIT
|
125
131
|
@messages = messages if messages != OMIT
|
@@ -138,6 +144,7 @@ module Vapi
|
|
138
144
|
@additional_properties = additional_properties
|
139
145
|
@_field_set = {
|
140
146
|
"phoneNumber": phone_number,
|
147
|
+
"type": type,
|
141
148
|
"status": status,
|
142
149
|
"endedReason": ended_reason,
|
143
150
|
"messages": messages,
|
@@ -169,6 +176,7 @@ module Vapi
|
|
169
176
|
phone_number = parsed_json["phoneNumber"].to_json
|
170
177
|
phone_number = Vapi::ServerMessageStatusUpdatePhoneNumber.from_json(json_object: phone_number)
|
171
178
|
end
|
179
|
+
type = parsed_json["type"]
|
172
180
|
status = parsed_json["status"]
|
173
181
|
ended_reason = parsed_json["endedReason"]
|
174
182
|
messages = parsed_json["messages"]&.map do |item|
|
@@ -215,6 +223,7 @@ module Vapi
|
|
215
223
|
inbound_phone_call_debugging_artifacts = parsed_json["inboundPhoneCallDebuggingArtifacts"]
|
216
224
|
new(
|
217
225
|
phone_number: phone_number,
|
226
|
+
type: type,
|
218
227
|
status: status,
|
219
228
|
ended_reason: ended_reason,
|
220
229
|
messages: messages,
|
@@ -247,6 +256,7 @@ module Vapi
|
|
247
256
|
# @return [Void]
|
248
257
|
def self.validate_raw(obj:)
|
249
258
|
obj.phone_number.nil? || Vapi::ServerMessageStatusUpdatePhoneNumber.validate_raw(obj: obj.phone_number)
|
259
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
250
260
|
obj.status.is_a?(Vapi::ServerMessageStatusUpdateStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
251
261
|
obj.ended_reason&.is_a?(Vapi::ServerMessageStatusUpdateEndedReason) != false || raise("Passed value for field obj.ended_reason is not the expected type, validation failed.")
|
252
262
|
obj.messages&.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.")
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Vapi
|
4
4
|
# This is the reason the call ended. This is only sent if the status is "ended".
|
5
5
|
class ServerMessageStatusUpdateEndedReason
|
6
|
-
|
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"
|
@@ -17,6 +17,8 @@ module Vapi
|
|
17
17
|
# - `call.phoneNumber`,
|
18
18
|
# - `call.phoneNumberId`.
|
19
19
|
attr_reader :phone_number
|
20
|
+
# @return [String] This is the type of the message. "tool-calls" is sent to call a tool.
|
21
|
+
attr_reader :type
|
20
22
|
# @return [Array<Vapi::ServerMessageToolCallsToolWithToolCallListItem>] This is the list of tools calls that the model is requesting along with the
|
21
23
|
# original tool configuration.
|
22
24
|
attr_reader :tool_with_tool_call_list
|
@@ -59,6 +61,7 @@ module Vapi
|
|
59
61
|
# This matches one of the following:
|
60
62
|
# - `call.phoneNumber`,
|
61
63
|
# - `call.phoneNumberId`.
|
64
|
+
# @param type [String] This is the type of the message. "tool-calls" is sent to call a tool.
|
62
65
|
# @param tool_with_tool_call_list [Array<Vapi::ServerMessageToolCallsToolWithToolCallListItem>] This is the list of tools calls that the model is requesting along with the
|
63
66
|
# original tool configuration.
|
64
67
|
# @param timestamp [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
@@ -84,9 +87,10 @@ module Vapi
|
|
84
87
|
# @param tool_call_list [Array<Vapi::ToolCall>] This is the list of tool calls that the model is requesting.
|
85
88
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
86
89
|
# @return [Vapi::ServerMessageToolCalls]
|
87
|
-
def initialize(tool_with_tool_call_list:, tool_call_list:, phone_number: OMIT,
|
88
|
-
customer: OMIT, call: OMIT, additional_properties: nil)
|
90
|
+
def initialize(tool_with_tool_call_list:, tool_call_list:, phone_number: OMIT, type: OMIT, timestamp: OMIT, artifact: OMIT,
|
91
|
+
assistant: OMIT, customer: OMIT, call: OMIT, additional_properties: nil)
|
89
92
|
@phone_number = phone_number if phone_number != OMIT
|
93
|
+
@type = type if type != OMIT
|
90
94
|
@tool_with_tool_call_list = tool_with_tool_call_list
|
91
95
|
@timestamp = timestamp if timestamp != OMIT
|
92
96
|
@artifact = artifact if artifact != OMIT
|
@@ -97,6 +101,7 @@ module Vapi
|
|
97
101
|
@additional_properties = additional_properties
|
98
102
|
@_field_set = {
|
99
103
|
"phoneNumber": phone_number,
|
104
|
+
"type": type,
|
100
105
|
"toolWithToolCallList": tool_with_tool_call_list,
|
101
106
|
"timestamp": timestamp,
|
102
107
|
"artifact": artifact,
|
@@ -122,6 +127,7 @@ module Vapi
|
|
122
127
|
phone_number = parsed_json["phoneNumber"].to_json
|
123
128
|
phone_number = Vapi::ServerMessageToolCallsPhoneNumber.from_json(json_object: phone_number)
|
124
129
|
end
|
130
|
+
type = parsed_json["type"]
|
125
131
|
tool_with_tool_call_list = parsed_json["toolWithToolCallList"]&.map do |item|
|
126
132
|
item = item.to_json
|
127
133
|
Vapi::ServerMessageToolCallsToolWithToolCallListItem.from_json(json_object: item)
|
@@ -157,6 +163,7 @@ module Vapi
|
|
157
163
|
end
|
158
164
|
new(
|
159
165
|
phone_number: phone_number,
|
166
|
+
type: type,
|
160
167
|
tool_with_tool_call_list: tool_with_tool_call_list,
|
161
168
|
timestamp: timestamp,
|
162
169
|
artifact: artifact,
|
@@ -183,6 +190,7 @@ module Vapi
|
|
183
190
|
# @return [Void]
|
184
191
|
def self.validate_raw(obj:)
|
185
192
|
obj.phone_number.nil? || Vapi::ServerMessageToolCallsPhoneNumber.validate_raw(obj: obj.phone_number)
|
193
|
+
obj.type&.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
186
194
|
obj.tool_with_tool_call_list.is_a?(Array) != false || raise("Passed value for field obj.tool_with_tool_call_list is not the expected type, validation failed.")
|
187
195
|
obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
188
196
|
obj.artifact.nil? || Vapi::Artifact.validate_raw(obj: obj.artifact)
|
@@ -4,9 +4,28 @@ require "json"
|
|
4
4
|
require_relative "function_tool_with_tool_call"
|
5
5
|
require_relative "ghl_tool_with_tool_call"
|
6
6
|
require_relative "make_tool_with_tool_call"
|
7
|
+
require_relative "bash_tool_with_tool_call"
|
8
|
+
require_relative "computer_tool_with_tool_call"
|
9
|
+
require_relative "text_editor_tool_with_tool_call"
|
7
10
|
|
8
11
|
module Vapi
|
9
12
|
class ServerMessageToolCallsToolWithToolCallListItem
|
13
|
+
# @return [Object]
|
14
|
+
attr_reader :member
|
15
|
+
# @return [String]
|
16
|
+
attr_reader :discriminant
|
17
|
+
|
18
|
+
private_class_method :new
|
19
|
+
alias kind_of? is_a?
|
20
|
+
|
21
|
+
# @param member [Object]
|
22
|
+
# @param discriminant [String]
|
23
|
+
# @return [Vapi::ServerMessageToolCallsToolWithToolCallListItem]
|
24
|
+
def initialize(member:, discriminant:)
|
25
|
+
@member = member
|
26
|
+
@discriminant = discriminant
|
27
|
+
end
|
28
|
+
|
10
29
|
# Deserialize a JSON object to an instance of
|
11
30
|
# ServerMessageToolCallsToolWithToolCallListItem
|
12
31
|
#
|
@@ -14,55 +33,46 @@ module Vapi
|
|
14
33
|
# @return [Vapi::ServerMessageToolCallsToolWithToolCallListItem]
|
15
34
|
def self.from_json(json_object:)
|
16
35
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
return Vapi::MakeToolWithToolCall.from_json(json_object: struct) unless struct.nil?
|
36
|
-
|
37
|
-
return nil
|
38
|
-
rescue StandardError
|
39
|
-
# noop
|
40
|
-
end
|
41
|
-
begin
|
42
|
-
struct.is_a?(Object) != false || raise("Passed value for field struct is not the expected type, validation failed.")
|
43
|
-
return struct unless struct.nil?
|
44
|
-
|
45
|
-
return nil
|
46
|
-
rescue StandardError
|
47
|
-
# noop
|
48
|
-
end
|
49
|
-
begin
|
50
|
-
struct.is_a?(Object) != false || raise("Passed value for field struct is not the expected type, validation failed.")
|
51
|
-
return struct unless struct.nil?
|
52
|
-
|
53
|
-
return nil
|
54
|
-
rescue StandardError
|
55
|
-
# noop
|
56
|
-
end
|
57
|
-
begin
|
58
|
-
struct.is_a?(Object) != false || raise("Passed value for field struct is not the expected type, validation failed.")
|
59
|
-
return struct unless struct.nil?
|
36
|
+
member = case struct.type
|
37
|
+
when "function"
|
38
|
+
Vapi::FunctionToolWithToolCall.from_json(json_object: json_object)
|
39
|
+
when "ghl"
|
40
|
+
Vapi::GhlToolWithToolCall.from_json(json_object: json_object)
|
41
|
+
when "make"
|
42
|
+
Vapi::MakeToolWithToolCall.from_json(json_object: json_object)
|
43
|
+
when "bash"
|
44
|
+
Vapi::BashToolWithToolCall.from_json(json_object: json_object)
|
45
|
+
when "computer"
|
46
|
+
Vapi::ComputerToolWithToolCall.from_json(json_object: json_object)
|
47
|
+
when "textEditor"
|
48
|
+
Vapi::TextEditorToolWithToolCall.from_json(json_object: json_object)
|
49
|
+
else
|
50
|
+
Vapi::FunctionToolWithToolCall.from_json(json_object: json_object)
|
51
|
+
end
|
52
|
+
new(member: member, discriminant: struct.type)
|
53
|
+
end
|
60
54
|
|
61
|
-
|
62
|
-
|
63
|
-
|
55
|
+
# For Union Types, to_json functionality is delegated to the wrapped member.
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def to_json(*_args)
|
59
|
+
case @discriminant
|
60
|
+
when "function"
|
61
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
62
|
+
when "ghl"
|
63
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
64
|
+
when "make"
|
65
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
66
|
+
when "bash"
|
67
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
68
|
+
when "computer"
|
69
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
70
|
+
when "textEditor"
|
71
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
72
|
+
else
|
73
|
+
{ "type": @discriminant, value: @member }.to_json
|
64
74
|
end
|
65
|
-
|
75
|
+
@member.to_json
|
66
76
|
end
|
67
77
|
|
68
78
|
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
@@ -72,37 +82,66 @@ module Vapi
|
|
72
82
|
# @param obj [Object]
|
73
83
|
# @return [Void]
|
74
84
|
def self.validate_raw(obj:)
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
begin
|
91
|
-
return obj.is_a?(Object) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
92
|
-
rescue StandardError
|
93
|
-
# noop
|
94
|
-
end
|
95
|
-
begin
|
96
|
-
return obj.is_a?(Object) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
97
|
-
rescue StandardError
|
98
|
-
# noop
|
99
|
-
end
|
100
|
-
begin
|
101
|
-
return obj.is_a?(Object) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
102
|
-
rescue StandardError
|
103
|
-
# noop
|
85
|
+
case obj.type
|
86
|
+
when "function"
|
87
|
+
Vapi::FunctionToolWithToolCall.validate_raw(obj: obj)
|
88
|
+
when "ghl"
|
89
|
+
Vapi::GhlToolWithToolCall.validate_raw(obj: obj)
|
90
|
+
when "make"
|
91
|
+
Vapi::MakeToolWithToolCall.validate_raw(obj: obj)
|
92
|
+
when "bash"
|
93
|
+
Vapi::BashToolWithToolCall.validate_raw(obj: obj)
|
94
|
+
when "computer"
|
95
|
+
Vapi::ComputerToolWithToolCall.validate_raw(obj: obj)
|
96
|
+
when "textEditor"
|
97
|
+
Vapi::TextEditorToolWithToolCall.validate_raw(obj: obj)
|
98
|
+
else
|
99
|
+
raise("Passed value matched no type within the union, validation failed.")
|
104
100
|
end
|
105
|
-
|
101
|
+
end
|
102
|
+
|
103
|
+
# For Union Types, is_a? functionality is delegated to the wrapped member.
|
104
|
+
#
|
105
|
+
# @param obj [Object]
|
106
|
+
# @return [Boolean]
|
107
|
+
def is_a?(obj)
|
108
|
+
@member.is_a?(obj)
|
109
|
+
end
|
110
|
+
|
111
|
+
# @param member [Vapi::FunctionToolWithToolCall]
|
112
|
+
# @return [Vapi::ServerMessageToolCallsToolWithToolCallListItem]
|
113
|
+
def self.function(member:)
|
114
|
+
new(member: member, discriminant: "function")
|
115
|
+
end
|
116
|
+
|
117
|
+
# @param member [Vapi::GhlToolWithToolCall]
|
118
|
+
# @return [Vapi::ServerMessageToolCallsToolWithToolCallListItem]
|
119
|
+
def self.ghl(member:)
|
120
|
+
new(member: member, discriminant: "ghl")
|
121
|
+
end
|
122
|
+
|
123
|
+
# @param member [Vapi::MakeToolWithToolCall]
|
124
|
+
# @return [Vapi::ServerMessageToolCallsToolWithToolCallListItem]
|
125
|
+
def self.make(member:)
|
126
|
+
new(member: member, discriminant: "make")
|
127
|
+
end
|
128
|
+
|
129
|
+
# @param member [Vapi::BashToolWithToolCall]
|
130
|
+
# @return [Vapi::ServerMessageToolCallsToolWithToolCallListItem]
|
131
|
+
def self.bash(member:)
|
132
|
+
new(member: member, discriminant: "bash")
|
133
|
+
end
|
134
|
+
|
135
|
+
# @param member [Vapi::ComputerToolWithToolCall]
|
136
|
+
# @return [Vapi::ServerMessageToolCallsToolWithToolCallListItem]
|
137
|
+
def self.computer(member:)
|
138
|
+
new(member: member, discriminant: "computer")
|
139
|
+
end
|
140
|
+
|
141
|
+
# @param member [Vapi::TextEditorToolWithToolCall]
|
142
|
+
# @return [Vapi::ServerMessageToolCallsToolWithToolCallListItem]
|
143
|
+
def self.text_editor(member:)
|
144
|
+
new(member: member, discriminant: "textEditor")
|
106
145
|
end
|
107
146
|
end
|
108
147
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "server_message_transcript_phone_number"
|
4
|
+
require_relative "server_message_transcript_type"
|
4
5
|
require_relative "artifact"
|
5
6
|
require_relative "create_assistant_dto"
|
6
7
|
require_relative "create_customer_dto"
|
@@ -17,6 +18,9 @@ module Vapi
|
|
17
18
|
# - `call.phoneNumber`,
|
18
19
|
# - `call.phoneNumberId`.
|
19
20
|
attr_reader :phone_number
|
21
|
+
# @return [Vapi::ServerMessageTranscriptType] This is the type of the message. "transcript" is sent as transcriber outputs
|
22
|
+
# partial or final transcript.
|
23
|
+
attr_reader :type
|
20
24
|
# @return [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
21
25
|
attr_reader :timestamp
|
22
26
|
# @return [Vapi::Artifact] This is a live version of the `call.artifact`.
|
@@ -60,6 +64,8 @@ module Vapi
|
|
60
64
|
# This matches one of the following:
|
61
65
|
# - `call.phoneNumber`,
|
62
66
|
# - `call.phoneNumberId`.
|
67
|
+
# @param type [Vapi::ServerMessageTranscriptType] This is the type of the message. "transcript" is sent as transcriber outputs
|
68
|
+
# partial or final transcript.
|
63
69
|
# @param timestamp [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
64
70
|
# @param artifact [Vapi::Artifact] This is a live version of the `call.artifact`.
|
65
71
|
# This matches what is stored on `call.artifact` after the call.
|
@@ -85,9 +91,10 @@ module Vapi
|
|
85
91
|
# @param transcript [String] This is the transcript content.
|
86
92
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
87
93
|
# @return [Vapi::ServerMessageTranscript]
|
88
|
-
def initialize(role:, transcript_type:, transcript:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT,
|
89
|
-
|
94
|
+
def initialize(type:, role:, transcript_type:, transcript:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
|
95
|
+
call: OMIT, additional_properties: nil)
|
90
96
|
@phone_number = phone_number if phone_number != OMIT
|
97
|
+
@type = type
|
91
98
|
@timestamp = timestamp if timestamp != OMIT
|
92
99
|
@artifact = artifact if artifact != OMIT
|
93
100
|
@assistant = assistant if assistant != OMIT
|
@@ -99,6 +106,7 @@ module Vapi
|
|
99
106
|
@additional_properties = additional_properties
|
100
107
|
@_field_set = {
|
101
108
|
"phoneNumber": phone_number,
|
109
|
+
"type": type,
|
102
110
|
"timestamp": timestamp,
|
103
111
|
"artifact": artifact,
|
104
112
|
"assistant": assistant,
|
@@ -125,6 +133,7 @@ module Vapi
|
|
125
133
|
phone_number = parsed_json["phoneNumber"].to_json
|
126
134
|
phone_number = Vapi::ServerMessageTranscriptPhoneNumber.from_json(json_object: phone_number)
|
127
135
|
end
|
136
|
+
type = parsed_json["type"]
|
128
137
|
timestamp = parsed_json["timestamp"]
|
129
138
|
if parsed_json["artifact"].nil?
|
130
139
|
artifact = nil
|
@@ -155,6 +164,7 @@ module Vapi
|
|
155
164
|
transcript = parsed_json["transcript"]
|
156
165
|
new(
|
157
166
|
phone_number: phone_number,
|
167
|
+
type: type,
|
158
168
|
timestamp: timestamp,
|
159
169
|
artifact: artifact,
|
160
170
|
assistant: assistant,
|
@@ -182,6 +192,7 @@ module Vapi
|
|
182
192
|
# @return [Void]
|
183
193
|
def self.validate_raw(obj:)
|
184
194
|
obj.phone_number.nil? || Vapi::ServerMessageTranscriptPhoneNumber.validate_raw(obj: obj.phone_number)
|
195
|
+
obj.type.is_a?(Vapi::ServerMessageTranscriptType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
185
196
|
obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
186
197
|
obj.artifact.nil? || Vapi::Artifact.validate_raw(obj: obj.artifact)
|
187
198
|
obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Vapi
|
4
|
+
# This is the type of the message. "transcript" is sent as transcriber outputs
|
5
|
+
# partial or final transcript.
|
6
|
+
class ServerMessageTranscriptType
|
7
|
+
TRANSCRIPT = "transcript"
|
8
|
+
TRANSCRIPT_TRANSCRIPT_TYPE_FINAL = "transcript[transcriptType='final']"
|
9
|
+
end
|
10
|
+
end
|
@@ -15,6 +15,9 @@ module Vapi
|
|
15
15
|
# - `call.phoneNumber`,
|
16
16
|
# - `call.phoneNumberId`.
|
17
17
|
attr_reader :phone_number
|
18
|
+
# @return [String] This is the type of the message. "transfer-destination-request" is sent when the
|
19
|
+
# model is requesting transfer but destination is unknown.
|
20
|
+
attr_reader :type
|
18
21
|
# @return [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
19
22
|
attr_reader :timestamp
|
20
23
|
# @return [Vapi::Artifact] This is a live version of the `call.artifact`.
|
@@ -52,6 +55,8 @@ module Vapi
|
|
52
55
|
# This matches one of the following:
|
53
56
|
# - `call.phoneNumber`,
|
54
57
|
# - `call.phoneNumberId`.
|
58
|
+
# @param type [String] This is the type of the message. "transfer-destination-request" is sent when the
|
59
|
+
# model is requesting transfer but destination is unknown.
|
55
60
|
# @param timestamp [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
56
61
|
# @param artifact [Vapi::Artifact] This is a live version of the `call.artifact`.
|
57
62
|
# This matches what is stored on `call.artifact` after the call.
|
@@ -74,9 +79,10 @@ module Vapi
|
|
74
79
|
# especially after the call is ended, use GET /call/:id.
|
75
80
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
76
81
|
# @return [Vapi::ServerMessageTransferDestinationRequest]
|
77
|
-
def initialize(phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
|
78
|
-
additional_properties: nil)
|
82
|
+
def initialize(type:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
|
83
|
+
call: OMIT, additional_properties: nil)
|
79
84
|
@phone_number = phone_number if phone_number != OMIT
|
85
|
+
@type = type
|
80
86
|
@timestamp = timestamp if timestamp != OMIT
|
81
87
|
@artifact = artifact if artifact != OMIT
|
82
88
|
@assistant = assistant if assistant != OMIT
|
@@ -85,6 +91,7 @@ module Vapi
|
|
85
91
|
@additional_properties = additional_properties
|
86
92
|
@_field_set = {
|
87
93
|
"phoneNumber": phone_number,
|
94
|
+
"type": type,
|
88
95
|
"timestamp": timestamp,
|
89
96
|
"artifact": artifact,
|
90
97
|
"assistant": assistant,
|
@@ -109,6 +116,7 @@ module Vapi
|
|
109
116
|
phone_number = parsed_json["phoneNumber"].to_json
|
110
117
|
phone_number = Vapi::ServerMessageTransferDestinationRequestPhoneNumber.from_json(json_object: phone_number)
|
111
118
|
end
|
119
|
+
type = parsed_json["type"]
|
112
120
|
timestamp = parsed_json["timestamp"]
|
113
121
|
if parsed_json["artifact"].nil?
|
114
122
|
artifact = nil
|
@@ -136,6 +144,7 @@ module Vapi
|
|
136
144
|
end
|
137
145
|
new(
|
138
146
|
phone_number: phone_number,
|
147
|
+
type: type,
|
139
148
|
timestamp: timestamp,
|
140
149
|
artifact: artifact,
|
141
150
|
assistant: assistant,
|
@@ -161,6 +170,7 @@ module Vapi
|
|
161
170
|
# @return [Void]
|
162
171
|
def self.validate_raw(obj:)
|
163
172
|
obj.phone_number.nil? || Vapi::ServerMessageTransferDestinationRequestPhoneNumber.validate_raw(obj: obj.phone_number)
|
173
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
164
174
|
obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
165
175
|
obj.artifact.nil? || Vapi::Artifact.validate_raw(obj: obj.artifact)
|
166
176
|
obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant)
|
@@ -16,6 +16,9 @@ module Vapi
|
|
16
16
|
# - `call.phoneNumber`,
|
17
17
|
# - `call.phoneNumberId`.
|
18
18
|
attr_reader :phone_number
|
19
|
+
# @return [String] This is the type of the message. "transfer-update" is sent whenever a transfer
|
20
|
+
# happens.
|
21
|
+
attr_reader :type
|
19
22
|
# @return [Vapi::ServerMessageTransferUpdateDestination] This is the destination of the transfer.
|
20
23
|
attr_reader :destination
|
21
24
|
# @return [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
@@ -65,6 +68,8 @@ module Vapi
|
|
65
68
|
# This matches one of the following:
|
66
69
|
# - `call.phoneNumber`,
|
67
70
|
# - `call.phoneNumberId`.
|
71
|
+
# @param type [String] This is the type of the message. "transfer-update" is sent whenever a transfer
|
72
|
+
# happens.
|
68
73
|
# @param destination [Vapi::ServerMessageTransferUpdateDestination] This is the destination of the transfer.
|
69
74
|
# @param timestamp [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
70
75
|
# @param artifact [Vapi::Artifact] This is a live version of the `call.artifact`.
|
@@ -94,9 +99,10 @@ module Vapi
|
|
94
99
|
# @param from_step_record [Hash{String => Object}] This is the step that the conversation moved from. =
|
95
100
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
96
101
|
# @return [Vapi::ServerMessageTransferUpdate]
|
97
|
-
def initialize(phone_number: OMIT, destination: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT,
|
102
|
+
def initialize(type:, phone_number: OMIT, destination: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT,
|
98
103
|
customer: OMIT, call: OMIT, to_assistant: OMIT, from_assistant: OMIT, to_step_record: OMIT, from_step_record: OMIT, additional_properties: nil)
|
99
104
|
@phone_number = phone_number if phone_number != OMIT
|
105
|
+
@type = type
|
100
106
|
@destination = destination if destination != OMIT
|
101
107
|
@timestamp = timestamp if timestamp != OMIT
|
102
108
|
@artifact = artifact if artifact != OMIT
|
@@ -110,6 +116,7 @@ module Vapi
|
|
110
116
|
@additional_properties = additional_properties
|
111
117
|
@_field_set = {
|
112
118
|
"phoneNumber": phone_number,
|
119
|
+
"type": type,
|
113
120
|
"destination": destination,
|
114
121
|
"timestamp": timestamp,
|
115
122
|
"artifact": artifact,
|
@@ -138,6 +145,7 @@ module Vapi
|
|
138
145
|
phone_number = parsed_json["phoneNumber"].to_json
|
139
146
|
phone_number = Vapi::ServerMessageTransferUpdatePhoneNumber.from_json(json_object: phone_number)
|
140
147
|
end
|
148
|
+
type = parsed_json["type"]
|
141
149
|
if parsed_json["destination"].nil?
|
142
150
|
destination = nil
|
143
151
|
else
|
@@ -185,6 +193,7 @@ module Vapi
|
|
185
193
|
from_step_record = parsed_json["fromStepRecord"]
|
186
194
|
new(
|
187
195
|
phone_number: phone_number,
|
196
|
+
type: type,
|
188
197
|
destination: destination,
|
189
198
|
timestamp: timestamp,
|
190
199
|
artifact: artifact,
|
@@ -214,6 +223,7 @@ module Vapi
|
|
214
223
|
# @return [Void]
|
215
224
|
def self.validate_raw(obj:)
|
216
225
|
obj.phone_number.nil? || Vapi::ServerMessageTransferUpdatePhoneNumber.validate_raw(obj: obj.phone_number)
|
226
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
217
227
|
obj.destination.nil? || Vapi::ServerMessageTransferUpdateDestination.validate_raw(obj: obj.destination)
|
218
228
|
obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
219
229
|
obj.artifact.nil? || Vapi::Artifact.validate_raw(obj: obj.artifact)
|
@@ -15,6 +15,9 @@ module Vapi
|
|
15
15
|
# - `call.phoneNumber`,
|
16
16
|
# - `call.phoneNumberId`.
|
17
17
|
attr_reader :phone_number
|
18
|
+
# @return [String] This is the type of the message. "user-interrupted" is sent when the user
|
19
|
+
# interrupts the assistant.
|
20
|
+
attr_reader :type
|
18
21
|
# @return [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
19
22
|
attr_reader :timestamp
|
20
23
|
# @return [Vapi::Artifact] This is a live version of the `call.artifact`.
|
@@ -52,6 +55,8 @@ module Vapi
|
|
52
55
|
# This matches one of the following:
|
53
56
|
# - `call.phoneNumber`,
|
54
57
|
# - `call.phoneNumberId`.
|
58
|
+
# @param type [String] This is the type of the message. "user-interrupted" is sent when the user
|
59
|
+
# interrupts the assistant.
|
55
60
|
# @param timestamp [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
56
61
|
# @param artifact [Vapi::Artifact] This is a live version of the `call.artifact`.
|
57
62
|
# This matches what is stored on `call.artifact` after the call.
|
@@ -74,9 +79,10 @@ module Vapi
|
|
74
79
|
# especially after the call is ended, use GET /call/:id.
|
75
80
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
76
81
|
# @return [Vapi::ServerMessageUserInterrupted]
|
77
|
-
def initialize(phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
|
78
|
-
additional_properties: nil)
|
82
|
+
def initialize(type:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
|
83
|
+
call: OMIT, additional_properties: nil)
|
79
84
|
@phone_number = phone_number if phone_number != OMIT
|
85
|
+
@type = type
|
80
86
|
@timestamp = timestamp if timestamp != OMIT
|
81
87
|
@artifact = artifact if artifact != OMIT
|
82
88
|
@assistant = assistant if assistant != OMIT
|
@@ -85,6 +91,7 @@ module Vapi
|
|
85
91
|
@additional_properties = additional_properties
|
86
92
|
@_field_set = {
|
87
93
|
"phoneNumber": phone_number,
|
94
|
+
"type": type,
|
88
95
|
"timestamp": timestamp,
|
89
96
|
"artifact": artifact,
|
90
97
|
"assistant": assistant,
|
@@ -108,6 +115,7 @@ module Vapi
|
|
108
115
|
phone_number = parsed_json["phoneNumber"].to_json
|
109
116
|
phone_number = Vapi::ServerMessageUserInterruptedPhoneNumber.from_json(json_object: phone_number)
|
110
117
|
end
|
118
|
+
type = parsed_json["type"]
|
111
119
|
timestamp = parsed_json["timestamp"]
|
112
120
|
if parsed_json["artifact"].nil?
|
113
121
|
artifact = nil
|
@@ -135,6 +143,7 @@ module Vapi
|
|
135
143
|
end
|
136
144
|
new(
|
137
145
|
phone_number: phone_number,
|
146
|
+
type: type,
|
138
147
|
timestamp: timestamp,
|
139
148
|
artifact: artifact,
|
140
149
|
assistant: assistant,
|
@@ -159,6 +168,7 @@ module Vapi
|
|
159
168
|
# @return [Void]
|
160
169
|
def self.validate_raw(obj:)
|
161
170
|
obj.phone_number.nil? || Vapi::ServerMessageUserInterruptedPhoneNumber.validate_raw(obj: obj.phone_number)
|
171
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
162
172
|
obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
163
173
|
obj.artifact.nil? || Vapi::Artifact.validate_raw(obj: obj.artifact)
|
164
174
|
obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant)
|