vapi_server_sdk 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +60 -14
- data/lib/vapi_server_sdk/analytics/client.rb +41 -12
- data/lib/vapi_server_sdk/assistants/client.rb +80 -14
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/calls/client.rb +104 -6
- data/lib/vapi_server_sdk/logs/client.rb +2 -2
- data/lib/vapi_server_sdk/squads/client.rb +128 -8
- data/lib/vapi_server_sdk/test_suite_runs/client.rb +328 -0
- data/lib/vapi_server_sdk/test_suite_runs/types/test_suite_run_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/test_suite_tests/client.rb +331 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_create_request.rb +81 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_remove_response.rb +82 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_update_request.rb +81 -0
- data/lib/vapi_server_sdk/test_suites/client.rb +338 -0
- data/lib/vapi_server_sdk/test_suites/types/test_suite_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/types/{semantic_edge_condition.rb → ai_edge_condition.rb} +9 -11
- data/lib/vapi_server_sdk/types/analytics_operation_column.rb +1 -0
- data/lib/vapi_server_sdk/types/analytics_operation_operation.rb +1 -0
- data/lib/vapi_server_sdk/types/analytics_query.rb +4 -3
- data/lib/vapi_server_sdk/types/analytics_query_table.rb +9 -0
- data/lib/vapi_server_sdk/types/api_request.rb +165 -0
- data/lib/vapi_server_sdk/types/api_request_method.rb +8 -0
- data/lib/vapi_server_sdk/types/api_request_mode.rb +10 -0
- data/lib/vapi_server_sdk/types/artifact.rb +12 -2
- data/lib/vapi_server_sdk/types/artifact_plan.rb +56 -8
- data/lib/vapi_server_sdk/types/assistant.rb +27 -13
- data/lib/vapi_server_sdk/types/assistant_hook_action_base.rb +47 -0
- data/lib/vapi_server_sdk/types/assistant_hook_filter.rb +72 -0
- data/lib/vapi_server_sdk/types/assistant_hooks.rb +82 -0
- data/lib/vapi_server_sdk/types/assistant_overrides.rb +28 -14
- data/lib/vapi_server_sdk/types/assistant_overrides_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/assistant_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/azure_open_ai_credential_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/backoff_plan.rb +80 -0
- data/lib/vapi_server_sdk/types/byo_phone_number.rb +10 -1
- data/lib/vapi_server_sdk/types/byo_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/call_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls.rb +69 -0
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls_emotion.rb +26 -0
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls_speed.rb +11 -0
- data/lib/vapi_server_sdk/types/cartesia_voice.rb +24 -10
- data/lib/vapi_server_sdk/types/chat_completion_message.rb +80 -0
- data/lib/vapi_server_sdk/types/chat_completion_message_metadata.rb +94 -0
- data/lib/vapi_server_sdk/types/chat_completions_dto.rb +84 -0
- data/lib/vapi_server_sdk/types/client_inbound_message_transfer.rb +13 -3
- data/lib/vapi_server_sdk/types/client_message_conversation_update.rb +15 -2
- data/lib/vapi_server_sdk/types/client_message_hang.rb +22 -4
- data/lib/vapi_server_sdk/types/client_message_language_change_detected.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_message.rb +165 -181
- data/lib/vapi_server_sdk/types/client_message_metadata.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_model_output.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_speech_update.rb +11 -2
- data/lib/vapi_server_sdk/types/client_message_tool_calls.rb +15 -2
- data/lib/vapi_server_sdk/types/client_message_tool_calls_result.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_transcript.rb +12 -2
- data/lib/vapi_server_sdk/types/client_message_transcript_type.rb +10 -0
- data/lib/vapi_server_sdk/types/client_message_transfer_update.rb +11 -1
- data/lib/vapi_server_sdk/types/client_message_user_interrupted.rb +14 -4
- data/lib/vapi_server_sdk/types/client_message_voice_input.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_workflow_node_started.rb +67 -0
- data/lib/vapi_server_sdk/types/compliance_plan.rb +77 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto.rb +28 -14
- data/lib/vapi_server_sdk/types/create_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_test_suite_test_voice_dto.rb +90 -0
- data/lib/vapi_server_sdk/types/create_vapi_phone_number_dto.rb +12 -4
- data/lib/vapi_server_sdk/types/create_workflow_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_workflow_dto_nodes_item.rb +104 -52
- data/lib/vapi_server_sdk/types/deep_seek_model.rb +4 -3
- data/lib/vapi_server_sdk/types/deep_seek_model_model.rb +9 -0
- data/lib/vapi_server_sdk/types/deepgram_transcriber.rb +28 -2
- data/lib/vapi_server_sdk/types/deepgram_voice.rb +22 -2
- data/lib/vapi_server_sdk/types/edge.rb +9 -2
- data/lib/vapi_server_sdk/types/edge_condition.rb +32 -19
- data/lib/vapi_server_sdk/types/failed_edge_condition.rb +47 -0
- data/lib/vapi_server_sdk/types/fallback_cartesia_voice.rb +24 -9
- data/lib/vapi_server_sdk/types/fallback_deepgram_voice.rb +17 -2
- data/lib/vapi_server_sdk/types/fallback_play_ht_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_id_enum.rb +22 -20
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/format_plan.rb +22 -2
- data/lib/vapi_server_sdk/types/format_plan_formatters_enabled_item.rb +22 -0
- data/lib/vapi_server_sdk/types/gather.rb +81 -25
- data/lib/vapi_server_sdk/types/google_model_model.rb +4 -0
- data/lib/vapi_server_sdk/types/groq_model_model.rb +1 -0
- data/lib/vapi_server_sdk/types/hangup.rb +67 -0
- data/lib/vapi_server_sdk/types/hook.rb +70 -0
- data/lib/vapi_server_sdk/types/hook_on.rb +9 -0
- data/lib/vapi_server_sdk/types/invite_user_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/json_schema.rb +26 -2
- data/lib/vapi_server_sdk/types/{programmatic_edge_condition.rb → logic_edge_condition.rb} +13 -15
- data/lib/vapi_server_sdk/types/message_plan.rb +12 -2
- data/lib/vapi_server_sdk/types/open_ai_model.rb +1 -9
- data/lib/vapi_server_sdk/types/open_ai_model_fallback_models_item.rb +2 -0
- data/lib/vapi_server_sdk/types/open_ai_model_model.rb +2 -0
- data/lib/vapi_server_sdk/types/play_ht_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/rime_ai_voice_id_enum.rb +22 -20
- data/lib/vapi_server_sdk/types/rime_ai_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/say.rb +23 -14
- data/lib/vapi_server_sdk/types/say_hook.rb +81 -0
- data/lib/vapi_server_sdk/types/server.rb +17 -2
- data/lib/vapi_server_sdk/types/server_message_assistant_request.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_conversation_update.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/server_message_hang.rb +20 -2
- data/lib/vapi_server_sdk/types/server_message_knowledge_base_request.rb +14 -2
- data/lib/vapi_server_sdk/types/server_message_language_change_detected.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_message.rb +212 -237
- data/lib/vapi_server_sdk/types/server_message_model_output.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_phone_call_control.rb +18 -2
- data/lib/vapi_server_sdk/types/server_message_speech_update.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_status_update.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_status_update_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/server_message_tool_calls.rb +10 -2
- data/lib/vapi_server_sdk/types/server_message_transcript.rb +13 -2
- data/lib/vapi_server_sdk/types/server_message_transcript_type.rb +10 -0
- data/lib/vapi_server_sdk/types/server_message_transfer_destination_request.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_transfer_update.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_user_interrupted.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_voice_input.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_voice_request.rb +50 -2
- data/lib/vapi_server_sdk/types/stop_speaking_plan.rb +27 -2
- data/lib/vapi_server_sdk/types/subscription.rb +33 -5
- data/lib/vapi_server_sdk/types/sync_voice_library_dto_providers_item.rb +1 -0
- data/lib/vapi_server_sdk/types/test_suite.rb +104 -0
- data/lib/vapi_server_sdk/types/test_suite_run.rb +127 -0
- data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb +80 -0
- data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai_result.rb +9 -0
- data/lib/vapi_server_sdk/types/test_suite_run_status.rb +10 -0
- data/lib/vapi_server_sdk/types/test_suite_run_test_attempt.rb +75 -0
- data/lib/vapi_server_sdk/types/{analytics_query_dto.rb → test_suite_run_test_attempt_call.rb} +19 -17
- data/lib/vapi_server_sdk/types/test_suite_run_test_result.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suite_runs_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suite_test_scorer_ai.rb +65 -0
- data/lib/vapi_server_sdk/types/test_suite_test_voice.rb +132 -0
- data/lib/vapi_server_sdk/types/test_suite_tests_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suites_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/time_range_step.rb +1 -0
- data/lib/vapi_server_sdk/types/tool_message_start.rb +18 -2
- data/lib/vapi_server_sdk/types/transfer.rb +74 -0
- data/lib/vapi_server_sdk/types/transfer_assistant_hook_action.rb +75 -0
- data/lib/vapi_server_sdk/types/{buy_phone_number_dto_fallback_destination.rb → transfer_assistant_hook_action_destination.rb} +9 -12
- data/lib/vapi_server_sdk/types/transfer_destination_assistant.rb +46 -0
- data/lib/vapi_server_sdk/types/transfer_plan.rb +37 -1
- data/lib/vapi_server_sdk/types/transfer_plan_mode.rb +4 -0
- data/lib/vapi_server_sdk/types/trieve_knowledge_base_search_plan.rb +12 -1
- data/lib/vapi_server_sdk/types/twilio_phone_number.rb +11 -2
- data/lib/vapi_server_sdk/types/twilio_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb +90 -0
- data/lib/vapi_server_sdk/types/vapi_phone_number.rb +29 -4
- data/lib/vapi_server_sdk/types/vapi_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/vonage_phone_number.rb +11 -2
- data/lib/vapi_server_sdk/types/vonage_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/workflow.rb +1 -9
- data/lib/vapi_server_sdk/types/workflow_nodes_item.rb +104 -52
- data/lib/vapi_server_sdk/types/xai_model.rb +4 -3
- data/lib/vapi_server_sdk/types/xai_model_model.rb +10 -0
- data/lib/vapi_server_sdk.rb +21 -0
- metadata +61 -12
- data/lib/vapi_server_sdk/types/buy_phone_number_dto.rb +0 -147
- data/lib/vapi_server_sdk/types/org_with_org_user.rb +0 -262
- data/lib/vapi_server_sdk/types/org_with_org_user_channel.rb +0 -10
- data/lib/vapi_server_sdk/types/org_with_org_user_role.rb +0 -9
- data/lib/vapi_server_sdk/types/update_workflow_dto.rb +0 -82
- data/lib/vapi_server_sdk/types/update_workflow_dto_nodes_item.rb +0 -81
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vapi
|
7
|
+
class SayHook
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :type
|
10
|
+
# @return [Hash{String => Object}] This is for metadata you want to store on the task.
|
11
|
+
attr_reader :metadata
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :exact
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :prompt
|
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 type [String]
|
25
|
+
# @param metadata [Hash{String => Object}] This is for metadata you want to store on the task.
|
26
|
+
# @param exact [String]
|
27
|
+
# @param prompt [String]
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [Vapi::SayHook]
|
30
|
+
def initialize(type:, metadata: OMIT, exact: OMIT, prompt: OMIT, additional_properties: nil)
|
31
|
+
@type = type
|
32
|
+
@metadata = metadata if metadata != OMIT
|
33
|
+
@exact = exact if exact != OMIT
|
34
|
+
@prompt = prompt if prompt != OMIT
|
35
|
+
@additional_properties = additional_properties
|
36
|
+
@_field_set = { "type": type, "metadata": metadata, "exact": exact, "prompt": prompt }.reject do |_k, v|
|
37
|
+
v == OMIT
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# Deserialize a JSON object to an instance of SayHook
|
42
|
+
#
|
43
|
+
# @param json_object [String]
|
44
|
+
# @return [Vapi::SayHook]
|
45
|
+
def self.from_json(json_object:)
|
46
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
47
|
+
parsed_json = JSON.parse(json_object)
|
48
|
+
type = parsed_json["type"]
|
49
|
+
metadata = parsed_json["metadata"]
|
50
|
+
exact = parsed_json["exact"]
|
51
|
+
prompt = parsed_json["prompt"]
|
52
|
+
new(
|
53
|
+
type: type,
|
54
|
+
metadata: metadata,
|
55
|
+
exact: exact,
|
56
|
+
prompt: prompt,
|
57
|
+
additional_properties: struct
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Serialize an instance of SayHook 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.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
76
|
+
obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
|
77
|
+
obj.exact&.is_a?(String) != false || raise("Passed value for field obj.exact is not the expected type, validation failed.")
|
78
|
+
obj.prompt&.is_a?(String) != false || raise("Passed value for field obj.prompt is not the expected type, validation failed.")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "backoff_plan"
|
3
4
|
require "ostruct"
|
4
5
|
require "json"
|
5
6
|
|
@@ -18,6 +19,8 @@ module Vapi
|
|
18
19
|
# @return [Hash{String => Object}] These are the custom headers to include in the request sent to your server.
|
19
20
|
# Each key-value pair represents a header name and its value.
|
20
21
|
attr_reader :headers
|
22
|
+
# @return [Vapi::BackoffPlan] This is the backoff plan to use if the request fails.
|
23
|
+
attr_reader :backoff_plan
|
21
24
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
22
25
|
attr_reader :additional_properties
|
23
26
|
# @return [Object]
|
@@ -35,19 +38,23 @@ module Vapi
|
|
35
38
|
# Same precedence logic as server.
|
36
39
|
# @param headers [Hash{String => Object}] These are the custom headers to include in the request sent to your server.
|
37
40
|
# Each key-value pair represents a header name and its value.
|
41
|
+
# @param backoff_plan [Vapi::BackoffPlan] This is the backoff plan to use if the request fails.
|
38
42
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
43
|
# @return [Vapi::Server]
|
40
|
-
def initialize(url:, timeout_seconds: OMIT, secret: OMIT, headers: OMIT,
|
44
|
+
def initialize(url:, timeout_seconds: OMIT, secret: OMIT, headers: OMIT, backoff_plan: OMIT,
|
45
|
+
additional_properties: nil)
|
41
46
|
@timeout_seconds = timeout_seconds if timeout_seconds != OMIT
|
42
47
|
@url = url
|
43
48
|
@secret = secret if secret != OMIT
|
44
49
|
@headers = headers if headers != OMIT
|
50
|
+
@backoff_plan = backoff_plan if backoff_plan != OMIT
|
45
51
|
@additional_properties = additional_properties
|
46
52
|
@_field_set = {
|
47
53
|
"timeoutSeconds": timeout_seconds,
|
48
54
|
"url": url,
|
49
55
|
"secret": secret,
|
50
|
-
"headers": headers
|
56
|
+
"headers": headers,
|
57
|
+
"backoffPlan": backoff_plan
|
51
58
|
}.reject do |_k, v|
|
52
59
|
v == OMIT
|
53
60
|
end
|
@@ -64,11 +71,18 @@ module Vapi
|
|
64
71
|
url = parsed_json["url"]
|
65
72
|
secret = parsed_json["secret"]
|
66
73
|
headers = parsed_json["headers"]
|
74
|
+
if parsed_json["backoffPlan"].nil?
|
75
|
+
backoff_plan = nil
|
76
|
+
else
|
77
|
+
backoff_plan = parsed_json["backoffPlan"].to_json
|
78
|
+
backoff_plan = Vapi::BackoffPlan.from_json(json_object: backoff_plan)
|
79
|
+
end
|
67
80
|
new(
|
68
81
|
timeout_seconds: timeout_seconds,
|
69
82
|
url: url,
|
70
83
|
secret: secret,
|
71
84
|
headers: headers,
|
85
|
+
backoff_plan: backoff_plan,
|
72
86
|
additional_properties: struct
|
73
87
|
)
|
74
88
|
end
|
@@ -91,6 +105,7 @@ module Vapi
|
|
91
105
|
obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
|
92
106
|
obj.secret&.is_a?(String) != false || raise("Passed value for field obj.secret is not the expected type, validation failed.")
|
93
107
|
obj.headers&.is_a?(Hash) != false || raise("Passed value for field obj.headers is not the expected type, validation failed.")
|
108
|
+
obj.backoff_plan.nil? || Vapi::BackoffPlan.validate_raw(obj: obj.backoff_plan)
|
94
109
|
end
|
95
110
|
end
|
96
111
|
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. "assistant-request" is sent to fetch assistant
|
19
|
+
# configuration for an incoming call.
|
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. "assistant-request" is sent to fetch assistant
|
59
|
+
# configuration for an incoming call.
|
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::ServerMessageAssistantRequest]
|
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::ServerMessageAssistantRequestPhoneNumber.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::ServerMessageAssistantRequestPhoneNumber.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)
|
@@ -17,6 +17,9 @@ 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. "conversation-update" is sent when an update is
|
21
|
+
# committed to the conversation history.
|
22
|
+
attr_reader :type
|
20
23
|
# @return [Array<Vapi::ServerMessageConversationUpdateMessagesItem>] This is the most up-to-date conversation history at the time the message is
|
21
24
|
# sent.
|
22
25
|
attr_reader :messages
|
@@ -60,6 +63,8 @@ module Vapi
|
|
60
63
|
# This matches one of the following:
|
61
64
|
# - `call.phoneNumber`,
|
62
65
|
# - `call.phoneNumberId`.
|
66
|
+
# @param type [String] This is the type of the message. "conversation-update" is sent when an update is
|
67
|
+
# committed to the conversation history.
|
63
68
|
# @param messages [Array<Vapi::ServerMessageConversationUpdateMessagesItem>] This is the most up-to-date conversation history at the time the message is
|
64
69
|
# sent.
|
65
70
|
# @param messages_open_ai_formatted [Array<Vapi::OpenAiMessage>] This is the most up-to-date conversation history at the time the message is
|
@@ -86,9 +91,10 @@ module Vapi
|
|
86
91
|
# especially after the call is ended, use GET /call/:id.
|
87
92
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
88
93
|
# @return [Vapi::ServerMessageConversationUpdate]
|
89
|
-
def initialize(messages_open_ai_formatted:, phone_number: OMIT, messages: OMIT, timestamp: OMIT,
|
90
|
-
assistant: OMIT, customer: OMIT, call: OMIT, additional_properties: nil)
|
94
|
+
def initialize(type:, messages_open_ai_formatted:, phone_number: OMIT, messages: OMIT, timestamp: OMIT,
|
95
|
+
artifact: OMIT, assistant: OMIT, customer: OMIT, call: OMIT, additional_properties: nil)
|
91
96
|
@phone_number = phone_number if phone_number != OMIT
|
97
|
+
@type = type
|
92
98
|
@messages = messages if messages != OMIT
|
93
99
|
@messages_open_ai_formatted = messages_open_ai_formatted
|
94
100
|
@timestamp = timestamp if timestamp != OMIT
|
@@ -99,6 +105,7 @@ module Vapi
|
|
99
105
|
@additional_properties = additional_properties
|
100
106
|
@_field_set = {
|
101
107
|
"phoneNumber": phone_number,
|
108
|
+
"type": type,
|
102
109
|
"messages": messages,
|
103
110
|
"messagesOpenAIFormatted": messages_open_ai_formatted,
|
104
111
|
"timestamp": timestamp,
|
@@ -124,6 +131,7 @@ module Vapi
|
|
124
131
|
phone_number = parsed_json["phoneNumber"].to_json
|
125
132
|
phone_number = Vapi::ServerMessageConversationUpdatePhoneNumber.from_json(json_object: phone_number)
|
126
133
|
end
|
134
|
+
type = parsed_json["type"]
|
127
135
|
messages = parsed_json["messages"]&.map do |item|
|
128
136
|
item = item.to_json
|
129
137
|
Vapi::ServerMessageConversationUpdateMessagesItem.from_json(json_object: item)
|
@@ -159,6 +167,7 @@ module Vapi
|
|
159
167
|
end
|
160
168
|
new(
|
161
169
|
phone_number: phone_number,
|
170
|
+
type: type,
|
162
171
|
messages: messages,
|
163
172
|
messages_open_ai_formatted: messages_open_ai_formatted,
|
164
173
|
timestamp: timestamp,
|
@@ -185,6 +194,7 @@ module Vapi
|
|
185
194
|
# @return [Void]
|
186
195
|
def self.validate_raw(obj:)
|
187
196
|
obj.phone_number.nil? || Vapi::ServerMessageConversationUpdatePhoneNumber.validate_raw(obj: obj.phone_number)
|
197
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
188
198
|
obj.messages&.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.")
|
189
199
|
obj.messages_open_ai_formatted.is_a?(Array) != false || raise("Passed value for field obj.messages_open_ai_formatted is not the expected type, validation failed.")
|
190
200
|
obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
@@ -19,6 +19,9 @@ module Vapi
|
|
19
19
|
# - `call.phoneNumber`,
|
20
20
|
# - `call.phoneNumberId`.
|
21
21
|
attr_reader :phone_number
|
22
|
+
# @return [String] This is the type of the message. "end-of-call-report" is sent when the call ends
|
23
|
+
# and post-processing is complete.
|
24
|
+
attr_reader :type
|
22
25
|
# @return [Vapi::ServerMessageEndOfCallReportEndedReason] This is the reason the call ended. This can also be found at `call.endedReason`
|
23
26
|
# on GET /call/:id.
|
24
27
|
attr_reader :ended_reason
|
@@ -74,6 +77,8 @@ module Vapi
|
|
74
77
|
# This matches one of the following:
|
75
78
|
# - `call.phoneNumber`,
|
76
79
|
# - `call.phoneNumberId`.
|
80
|
+
# @param type [String] This is the type of the message. "end-of-call-report" is sent when the call ends
|
81
|
+
# and post-processing is complete.
|
77
82
|
# @param ended_reason [Vapi::ServerMessageEndOfCallReportEndedReason] This is the reason the call ended. This can also be found at `call.endedReason`
|
78
83
|
# on GET /call/:id.
|
79
84
|
# @param cost [Float] This is the cost of the call in USD. This can also be found at `call.cost` on
|
@@ -108,9 +113,10 @@ module Vapi
|
|
108
113
|
# found at `call.endedAt` on GET /call/:id.
|
109
114
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
110
115
|
# @return [Vapi::ServerMessageEndOfCallReport]
|
111
|
-
def initialize(ended_reason:, artifact:, analysis:, phone_number: OMIT, cost: OMIT, costs: OMIT, timestamp: OMIT,
|
116
|
+
def initialize(type:, ended_reason:, artifact:, analysis:, phone_number: OMIT, cost: OMIT, costs: OMIT, timestamp: OMIT,
|
112
117
|
assistant: OMIT, customer: OMIT, call: OMIT, started_at: OMIT, ended_at: OMIT, additional_properties: nil)
|
113
118
|
@phone_number = phone_number if phone_number != OMIT
|
119
|
+
@type = type
|
114
120
|
@ended_reason = ended_reason
|
115
121
|
@cost = cost if cost != OMIT
|
116
122
|
@costs = costs if costs != OMIT
|
@@ -125,6 +131,7 @@ module Vapi
|
|
125
131
|
@additional_properties = additional_properties
|
126
132
|
@_field_set = {
|
127
133
|
"phoneNumber": phone_number,
|
134
|
+
"type": type,
|
128
135
|
"endedReason": ended_reason,
|
129
136
|
"cost": cost,
|
130
137
|
"costs": costs,
|
@@ -154,6 +161,7 @@ module Vapi
|
|
154
161
|
phone_number = parsed_json["phoneNumber"].to_json
|
155
162
|
phone_number = Vapi::ServerMessageEndOfCallReportPhoneNumber.from_json(json_object: phone_number)
|
156
163
|
end
|
164
|
+
type = parsed_json["type"]
|
157
165
|
ended_reason = parsed_json["endedReason"]
|
158
166
|
cost = parsed_json["cost"]
|
159
167
|
costs = parsed_json["costs"]&.map do |item|
|
@@ -195,6 +203,7 @@ module Vapi
|
|
195
203
|
ended_at = (DateTime.parse(parsed_json["endedAt"]) unless parsed_json["endedAt"].nil?)
|
196
204
|
new(
|
197
205
|
phone_number: phone_number,
|
206
|
+
type: type,
|
198
207
|
ended_reason: ended_reason,
|
199
208
|
cost: cost,
|
200
209
|
costs: costs,
|
@@ -225,6 +234,7 @@ module Vapi
|
|
225
234
|
# @return [Void]
|
226
235
|
def self.validate_raw(obj:)
|
227
236
|
obj.phone_number.nil? || Vapi::ServerMessageEndOfCallReportPhoneNumber.validate_raw(obj: obj.phone_number)
|
237
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
228
238
|
obj.ended_reason.is_a?(Vapi::ServerMessageEndOfCallReportEndedReason) != false || raise("Passed value for field obj.ended_reason is not the expected type, validation failed.")
|
229
239
|
obj.cost&.is_a?(Float) != false || raise("Passed value for field obj.cost is not the expected type, validation failed.")
|
230
240
|
obj.costs&.is_a?(Array) != false || raise("Passed value for field obj.costs is not the expected type, validation failed.")
|
@@ -4,7 +4,7 @@ module Vapi
|
|
4
4
|
# This is the reason the call ended. This can also be found at `call.endedReason`
|
5
5
|
# on GET /call/:id.
|
6
6
|
class ServerMessageEndOfCallReportEndedReason
|
7
|
-
|
7
|
+
ASSISTANT_NOT_VALID = "assistant-not-valid"
|
8
8
|
ASSISTANT_NOT_PROVIDED = "assistant-not-provided"
|
9
9
|
CALL_START_ERROR_NEITHER_ASSISTANT_NOR_SERVER_SET = "call-start-error-neither-assistant-nor-server-set"
|
10
10
|
ASSISTANT_REQUEST_FAILED = "assistant-request-failed"
|
@@ -15,6 +15,7 @@ module Vapi
|
|
15
15
|
ASSISTANT_REQUEST_RETURNED_FORWARDING_PHONE_NUMBER = "assistant-request-returned-forwarding-phone-number"
|
16
16
|
ASSISTANT_ENDED_CALL = "assistant-ended-call"
|
17
17
|
ASSISTANT_SAID_END_CALL_PHRASE = "assistant-said-end-call-phrase"
|
18
|
+
ASSISTANT_ENDED_CALL_WITH_HANGUP_TASK = "assistant-ended-call-with-hangup-task"
|
18
19
|
ASSISTANT_FORWARDED_CALL = "assistant-forwarded-call"
|
19
20
|
ASSISTANT_JOIN_TIMED_OUT = "assistant-join-timed-out"
|
20
21
|
CUSTOMER_BUSY = "customer-busy"
|
@@ -38,8 +39,10 @@ module Vapi
|
|
38
39
|
PIPELINE_ERROR_RIME_AI_VOICE_FAILED = "pipeline-error-rime-ai-voice-failed"
|
39
40
|
PIPELINE_ERROR_NEETS_VOICE_FAILED = "pipeline-error-neets-voice-failed"
|
40
41
|
PIPELINE_ERROR_SMALLEST_AI_VOICE_FAILED = "pipeline-error-smallest-ai-voice-failed"
|
42
|
+
PIPELINE_ERROR_NEUPHONIC_VOICE_FAILED = "pipeline-error-neuphonic-voice-failed"
|
41
43
|
PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED = "pipeline-error-deepgram-transcriber-failed"
|
42
44
|
PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED = "pipeline-error-gladia-transcriber-failed"
|
45
|
+
PIPELINE_ERROR_SPEECHMATICS_TRANSCRIBER_FAILED = "pipeline-error-speechmatics-transcriber-failed"
|
43
46
|
PIPELINE_ERROR_ASSEMBLY_AI_TRANSCRIBER_FAILED = "pipeline-error-assembly-ai-transcriber-failed"
|
44
47
|
PIPELINE_ERROR_TALKSCRIBER_TRANSCRIBER_FAILED = "pipeline-error-talkscriber-transcriber-failed"
|
45
48
|
PIPELINE_ERROR_AZURE_SPEECH_TRANSCRIBER_FAILED = "pipeline-error-azure-speech-transcriber-failed"
|
@@ -67,6 +70,7 @@ module Vapi
|
|
67
70
|
PIPELINE_ERROR_GROQ_LLM_FAILED = "pipeline-error-groq-llm-failed"
|
68
71
|
PIPELINE_ERROR_GOOGLE_LLM_FAILED = "pipeline-error-google-llm-failed"
|
69
72
|
PIPELINE_ERROR_XAI_LLM_FAILED = "pipeline-error-xai-llm-failed"
|
73
|
+
PIPELINE_ERROR_MISTRAL_LLM_FAILED = "pipeline-error-mistral-llm-failed"
|
70
74
|
PIPELINE_ERROR_INFLECTION_AI_LLM_FAILED = "pipeline-error-inflection-ai-llm-failed"
|
71
75
|
PIPELINE_ERROR_CEREBRAS_LLM_FAILED = "pipeline-error-cerebras-llm-failed"
|
72
76
|
PIPELINE_ERROR_DEEP_SEEK_LLM_FAILED = "pipeline-error-deep-seek-llm-failed"
|
@@ -85,6 +89,11 @@ module Vapi
|
|
85
89
|
PIPELINE_ERROR_XAI_403_MODEL_ACCESS_DENIED = "pipeline-error-xai-403-model-access-denied"
|
86
90
|
PIPELINE_ERROR_XAI_429_EXCEEDED_QUOTA = "pipeline-error-xai-429-exceeded-quota"
|
87
91
|
PIPELINE_ERROR_XAI_500_SERVER_ERROR = "pipeline-error-xai-500-server-error"
|
92
|
+
PIPELINE_ERROR_MISTRAL_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-mistral-400-bad-request-validation-failed"
|
93
|
+
PIPELINE_ERROR_MISTRAL_401_UNAUTHORIZED = "pipeline-error-mistral-401-unauthorized"
|
94
|
+
PIPELINE_ERROR_MISTRAL_403_MODEL_ACCESS_DENIED = "pipeline-error-mistral-403-model-access-denied"
|
95
|
+
PIPELINE_ERROR_MISTRAL_429_EXCEEDED_QUOTA = "pipeline-error-mistral-429-exceeded-quota"
|
96
|
+
PIPELINE_ERROR_MISTRAL_500_SERVER_ERROR = "pipeline-error-mistral-500-server-error"
|
88
97
|
PIPELINE_ERROR_INFLECTION_AI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-inflection-ai-400-bad-request-validation-failed"
|
89
98
|
PIPELINE_ERROR_INFLECTION_AI_401_UNAUTHORIZED = "pipeline-error-inflection-ai-401-unauthorized"
|
90
99
|
PIPELINE_ERROR_INFLECTION_AI_403_MODEL_ACCESS_DENIED = "pipeline-error-inflection-ai-403-model-access-denied"
|
@@ -15,6 +15,13 @@ 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. "hang" is sent when the assistant is hanging
|
19
|
+
# due to a delay. The delay can be caused by many factors, such as:
|
20
|
+
# - the model is too slow to respond
|
21
|
+
# - the voice is too slow to respond
|
22
|
+
# - the tool call is still waiting for a response from your server
|
23
|
+
# - etc.
|
24
|
+
attr_reader :type
|
18
25
|
# @return [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
19
26
|
attr_reader :timestamp
|
20
27
|
# @return [Vapi::Artifact] This is a live version of the `call.artifact`.
|
@@ -52,6 +59,12 @@ module Vapi
|
|
52
59
|
# This matches one of the following:
|
53
60
|
# - `call.phoneNumber`,
|
54
61
|
# - `call.phoneNumberId`.
|
62
|
+
# @param type [String] This is the type of the message. "hang" is sent when the assistant is hanging
|
63
|
+
# due to a delay. The delay can be caused by many factors, such as:
|
64
|
+
# - the model is too slow to respond
|
65
|
+
# - the voice is too slow to respond
|
66
|
+
# - the tool call is still waiting for a response from your server
|
67
|
+
# - etc.
|
55
68
|
# @param timestamp [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
56
69
|
# @param artifact [Vapi::Artifact] This is a live version of the `call.artifact`.
|
57
70
|
# This matches what is stored on `call.artifact` after the call.
|
@@ -74,9 +87,10 @@ module Vapi
|
|
74
87
|
# especially after the call is ended, use GET /call/:id.
|
75
88
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
76
89
|
# @return [Vapi::ServerMessageHang]
|
77
|
-
def initialize(phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
|
78
|
-
additional_properties: nil)
|
90
|
+
def initialize(type:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
|
91
|
+
call: OMIT, additional_properties: nil)
|
79
92
|
@phone_number = phone_number if phone_number != OMIT
|
93
|
+
@type = type
|
80
94
|
@timestamp = timestamp if timestamp != OMIT
|
81
95
|
@artifact = artifact if artifact != OMIT
|
82
96
|
@assistant = assistant if assistant != OMIT
|
@@ -85,6 +99,7 @@ module Vapi
|
|
85
99
|
@additional_properties = additional_properties
|
86
100
|
@_field_set = {
|
87
101
|
"phoneNumber": phone_number,
|
102
|
+
"type": type,
|
88
103
|
"timestamp": timestamp,
|
89
104
|
"artifact": artifact,
|
90
105
|
"assistant": assistant,
|
@@ -108,6 +123,7 @@ module Vapi
|
|
108
123
|
phone_number = parsed_json["phoneNumber"].to_json
|
109
124
|
phone_number = Vapi::ServerMessageHangPhoneNumber.from_json(json_object: phone_number)
|
110
125
|
end
|
126
|
+
type = parsed_json["type"]
|
111
127
|
timestamp = parsed_json["timestamp"]
|
112
128
|
if parsed_json["artifact"].nil?
|
113
129
|
artifact = nil
|
@@ -135,6 +151,7 @@ module Vapi
|
|
135
151
|
end
|
136
152
|
new(
|
137
153
|
phone_number: phone_number,
|
154
|
+
type: type,
|
138
155
|
timestamp: timestamp,
|
139
156
|
artifact: artifact,
|
140
157
|
assistant: assistant,
|
@@ -159,6 +176,7 @@ module Vapi
|
|
159
176
|
# @return [Void]
|
160
177
|
def self.validate_raw(obj:)
|
161
178
|
obj.phone_number.nil? || Vapi::ServerMessageHangPhoneNumber.validate_raw(obj: obj.phone_number)
|
179
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
162
180
|
obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
163
181
|
obj.artifact.nil? || Vapi::Artifact.validate_raw(obj: obj.artifact)
|
164
182
|
obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant)
|
@@ -17,6 +17,10 @@ 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. "knowledge-base-request" is sent to request
|
21
|
+
# knowledge base documents. To enable, use
|
22
|
+
# `assistant.knowledgeBase.provider=custom-knowledge-base`.
|
23
|
+
attr_reader :type
|
20
24
|
# @return [Array<Vapi::ServerMessageKnowledgeBaseRequestMessagesItem>] These are the messages that are going to be sent to the `model` right after the
|
21
25
|
# `knowledge-base-request` webhook completes.
|
22
26
|
attr_reader :messages
|
@@ -59,6 +63,9 @@ module Vapi
|
|
59
63
|
# This matches one of the following:
|
60
64
|
# - `call.phoneNumber`,
|
61
65
|
# - `call.phoneNumberId`.
|
66
|
+
# @param type [String] This is the type of the message. "knowledge-base-request" is sent to request
|
67
|
+
# knowledge base documents. To enable, use
|
68
|
+
# `assistant.knowledgeBase.provider=custom-knowledge-base`.
|
62
69
|
# @param messages [Array<Vapi::ServerMessageKnowledgeBaseRequestMessagesItem>] These are the messages that are going to be sent to the `model` right after the
|
63
70
|
# `knowledge-base-request` webhook completes.
|
64
71
|
# @param messages_open_ai_formatted [Array<Vapi::OpenAiMessage>] This is just `messages` formatted for OpenAI.
|
@@ -84,9 +91,10 @@ module Vapi
|
|
84
91
|
# especially after the call is ended, use GET /call/:id.
|
85
92
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
86
93
|
# @return [Vapi::ServerMessageKnowledgeBaseRequest]
|
87
|
-
def initialize(messages_open_ai_formatted:, phone_number: OMIT, messages: OMIT, timestamp: OMIT,
|
88
|
-
assistant: OMIT, customer: OMIT, call: OMIT, additional_properties: nil)
|
94
|
+
def initialize(type:, messages_open_ai_formatted:, phone_number: OMIT, messages: OMIT, timestamp: OMIT,
|
95
|
+
artifact: OMIT, assistant: OMIT, customer: OMIT, call: OMIT, additional_properties: nil)
|
89
96
|
@phone_number = phone_number if phone_number != OMIT
|
97
|
+
@type = type
|
90
98
|
@messages = messages if messages != OMIT
|
91
99
|
@messages_open_ai_formatted = messages_open_ai_formatted
|
92
100
|
@timestamp = timestamp if timestamp != OMIT
|
@@ -97,6 +105,7 @@ module Vapi
|
|
97
105
|
@additional_properties = additional_properties
|
98
106
|
@_field_set = {
|
99
107
|
"phoneNumber": phone_number,
|
108
|
+
"type": type,
|
100
109
|
"messages": messages,
|
101
110
|
"messagesOpenAIFormatted": messages_open_ai_formatted,
|
102
111
|
"timestamp": timestamp,
|
@@ -122,6 +131,7 @@ module Vapi
|
|
122
131
|
phone_number = parsed_json["phoneNumber"].to_json
|
123
132
|
phone_number = Vapi::ServerMessageKnowledgeBaseRequestPhoneNumber.from_json(json_object: phone_number)
|
124
133
|
end
|
134
|
+
type = parsed_json["type"]
|
125
135
|
messages = parsed_json["messages"]&.map do |item|
|
126
136
|
item = item.to_json
|
127
137
|
Vapi::ServerMessageKnowledgeBaseRequestMessagesItem.from_json(json_object: item)
|
@@ -157,6 +167,7 @@ module Vapi
|
|
157
167
|
end
|
158
168
|
new(
|
159
169
|
phone_number: phone_number,
|
170
|
+
type: type,
|
160
171
|
messages: messages,
|
161
172
|
messages_open_ai_formatted: messages_open_ai_formatted,
|
162
173
|
timestamp: timestamp,
|
@@ -183,6 +194,7 @@ module Vapi
|
|
183
194
|
# @return [Void]
|
184
195
|
def self.validate_raw(obj:)
|
185
196
|
obj.phone_number.nil? || Vapi::ServerMessageKnowledgeBaseRequestPhoneNumber.validate_raw(obj: obj.phone_number)
|
197
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
186
198
|
obj.messages&.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.")
|
187
199
|
obj.messages_open_ai_formatted.is_a?(Array) != false || raise("Passed value for field obj.messages_open_ai_formatted is not the expected type, validation failed.")
|
188
200
|
obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
@@ -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. "language-change-detected" is sent when the
|
19
|
+
# transcriber is automatically switched based on the detected language.
|
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`.
|
@@ -54,6 +57,8 @@ module Vapi
|
|
54
57
|
# This matches one of the following:
|
55
58
|
# - `call.phoneNumber`,
|
56
59
|
# - `call.phoneNumberId`.
|
60
|
+
# @param type [String] This is the type of the message. "language-change-detected" is sent when the
|
61
|
+
# transcriber is automatically switched based on the detected language.
|
57
62
|
# @param timestamp [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
58
63
|
# @param artifact [Vapi::Artifact] This is a live version of the `call.artifact`.
|
59
64
|
# This matches what is stored on `call.artifact` after the call.
|
@@ -77,9 +82,10 @@ module Vapi
|
|
77
82
|
# @param language [String] This is the language the transcriber is switched to.
|
78
83
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
79
84
|
# @return [Vapi::ServerMessageLanguageChangeDetected]
|
80
|
-
def initialize(language:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
|
85
|
+
def initialize(type:, language:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
|
81
86
|
call: OMIT, additional_properties: nil)
|
82
87
|
@phone_number = phone_number if phone_number != OMIT
|
88
|
+
@type = type
|
83
89
|
@timestamp = timestamp if timestamp != OMIT
|
84
90
|
@artifact = artifact if artifact != OMIT
|
85
91
|
@assistant = assistant if assistant != OMIT
|
@@ -89,6 +95,7 @@ module Vapi
|
|
89
95
|
@additional_properties = additional_properties
|
90
96
|
@_field_set = {
|
91
97
|
"phoneNumber": phone_number,
|
98
|
+
"type": type,
|
92
99
|
"timestamp": timestamp,
|
93
100
|
"artifact": artifact,
|
94
101
|
"assistant": assistant,
|
@@ -113,6 +120,7 @@ module Vapi
|
|
113
120
|
phone_number = parsed_json["phoneNumber"].to_json
|
114
121
|
phone_number = Vapi::ServerMessageLanguageChangeDetectedPhoneNumber.from_json(json_object: phone_number)
|
115
122
|
end
|
123
|
+
type = parsed_json["type"]
|
116
124
|
timestamp = parsed_json["timestamp"]
|
117
125
|
if parsed_json["artifact"].nil?
|
118
126
|
artifact = nil
|
@@ -141,6 +149,7 @@ module Vapi
|
|
141
149
|
language = parsed_json["language"]
|
142
150
|
new(
|
143
151
|
phone_number: phone_number,
|
152
|
+
type: type,
|
144
153
|
timestamp: timestamp,
|
145
154
|
artifact: artifact,
|
146
155
|
assistant: assistant,
|
@@ -166,6 +175,7 @@ module Vapi
|
|
166
175
|
# @return [Void]
|
167
176
|
def self.validate_raw(obj:)
|
168
177
|
obj.phone_number.nil? || Vapi::ServerMessageLanguageChangeDetectedPhoneNumber.validate_raw(obj: obj.phone_number)
|
178
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
169
179
|
obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
170
180
|
obj.artifact.nil? || Vapi::Artifact.validate_raw(obj: obj.artifact)
|
171
181
|
obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant)
|