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
data/lib/vapi_server_sdk/types/{analytics_query_dto.rb → test_suite_run_test_attempt_call.rb}
RENAMED
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
3
|
+
require_relative "artifact"
|
4
4
|
require "ostruct"
|
5
5
|
require "json"
|
6
6
|
|
7
7
|
module Vapi
|
8
|
-
class
|
9
|
-
# @return [
|
10
|
-
attr_reader :
|
8
|
+
class TestSuiteRunTestAttemptCall
|
9
|
+
# @return [Vapi::Artifact] This is the artifact associated with the call.
|
10
|
+
attr_reader :artifact
|
11
11
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
12
12
|
attr_reader :additional_properties
|
13
13
|
# @return [Object]
|
@@ -16,30 +16,32 @@ module Vapi
|
|
16
16
|
|
17
17
|
OMIT = Object.new
|
18
18
|
|
19
|
-
# @param
|
19
|
+
# @param artifact [Vapi::Artifact] This is the artifact associated with the call.
|
20
20
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
-
# @return [Vapi::
|
22
|
-
def initialize(
|
23
|
-
@
|
21
|
+
# @return [Vapi::TestSuiteRunTestAttemptCall]
|
22
|
+
def initialize(artifact:, additional_properties: nil)
|
23
|
+
@artifact = artifact
|
24
24
|
@additional_properties = additional_properties
|
25
|
-
@_field_set = { "
|
25
|
+
@_field_set = { "artifact": artifact }
|
26
26
|
end
|
27
27
|
|
28
|
-
# Deserialize a JSON object to an instance of
|
28
|
+
# Deserialize a JSON object to an instance of TestSuiteRunTestAttemptCall
|
29
29
|
#
|
30
30
|
# @param json_object [String]
|
31
|
-
# @return [Vapi::
|
31
|
+
# @return [Vapi::TestSuiteRunTestAttemptCall]
|
32
32
|
def self.from_json(json_object:)
|
33
33
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
34
34
|
parsed_json = JSON.parse(json_object)
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
if parsed_json["artifact"].nil?
|
36
|
+
artifact = nil
|
37
|
+
else
|
38
|
+
artifact = parsed_json["artifact"].to_json
|
39
|
+
artifact = Vapi::Artifact.from_json(json_object: artifact)
|
38
40
|
end
|
39
|
-
new(
|
41
|
+
new(artifact: artifact, additional_properties: struct)
|
40
42
|
end
|
41
43
|
|
42
|
-
# Serialize an instance of
|
44
|
+
# Serialize an instance of TestSuiteRunTestAttemptCall to a JSON object
|
43
45
|
#
|
44
46
|
# @return [String]
|
45
47
|
def to_json(*_args)
|
@@ -53,7 +55,7 @@ module Vapi
|
|
53
55
|
# @param obj [Object]
|
54
56
|
# @return [Void]
|
55
57
|
def self.validate_raw(obj:)
|
56
|
-
|
58
|
+
Vapi::Artifact.validate_raw(obj: obj.artifact)
|
57
59
|
end
|
58
60
|
end
|
59
61
|
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_suite_test_voice"
|
4
|
+
require_relative "test_suite_run_test_attempt"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class TestSuiteRunTestResult
|
10
|
+
# @return [Vapi::TestSuiteTestVoice] This is the test that was run.
|
11
|
+
attr_reader :test
|
12
|
+
# @return [Array<Vapi::TestSuiteRunTestAttempt>] These are the attempts made for this test.
|
13
|
+
attr_reader :attempts
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param test [Vapi::TestSuiteTestVoice] This is the test that was run.
|
23
|
+
# @param attempts [Array<Vapi::TestSuiteRunTestAttempt>] These are the attempts made for this test.
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [Vapi::TestSuiteRunTestResult]
|
26
|
+
def initialize(test:, attempts:, additional_properties: nil)
|
27
|
+
@test = test
|
28
|
+
@attempts = attempts
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "test": test, "attempts": attempts }
|
31
|
+
end
|
32
|
+
|
33
|
+
# Deserialize a JSON object to an instance of TestSuiteRunTestResult
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [Vapi::TestSuiteRunTestResult]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
parsed_json = JSON.parse(json_object)
|
40
|
+
if parsed_json["test"].nil?
|
41
|
+
test = nil
|
42
|
+
else
|
43
|
+
test = parsed_json["test"].to_json
|
44
|
+
test = Vapi::TestSuiteTestVoice.from_json(json_object: test)
|
45
|
+
end
|
46
|
+
attempts = parsed_json["attempts"]&.map do |item|
|
47
|
+
item = item.to_json
|
48
|
+
Vapi::TestSuiteRunTestAttempt.from_json(json_object: item)
|
49
|
+
end
|
50
|
+
new(
|
51
|
+
test: test,
|
52
|
+
attempts: attempts,
|
53
|
+
additional_properties: struct
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Serialize an instance of TestSuiteRunTestResult to a JSON object
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
def to_json(*_args)
|
61
|
+
@_field_set&.to_json
|
62
|
+
end
|
63
|
+
|
64
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
65
|
+
# hash and check each fields type against the current object's property
|
66
|
+
# definitions.
|
67
|
+
#
|
68
|
+
# @param obj [Object]
|
69
|
+
# @return [Void]
|
70
|
+
def self.validate_raw(obj:)
|
71
|
+
Vapi::TestSuiteTestVoice.validate_raw(obj: obj.test)
|
72
|
+
obj.attempts.is_a?(Array) != false || raise("Passed value for field obj.attempts is not the expected type, validation failed.")
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_suite_run"
|
4
|
+
require_relative "pagination_meta"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class TestSuiteRunsPaginatedResponse
|
10
|
+
# @return [Array<Vapi::TestSuiteRun>]
|
11
|
+
attr_reader :results
|
12
|
+
# @return [Vapi::PaginationMeta]
|
13
|
+
attr_reader :metadata
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param results [Array<Vapi::TestSuiteRun>]
|
23
|
+
# @param metadata [Vapi::PaginationMeta]
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [Vapi::TestSuiteRunsPaginatedResponse]
|
26
|
+
def initialize(results:, metadata:, additional_properties: nil)
|
27
|
+
@results = results
|
28
|
+
@metadata = metadata
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "results": results, "metadata": metadata }
|
31
|
+
end
|
32
|
+
|
33
|
+
# Deserialize a JSON object to an instance of TestSuiteRunsPaginatedResponse
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [Vapi::TestSuiteRunsPaginatedResponse]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
parsed_json = JSON.parse(json_object)
|
40
|
+
results = parsed_json["results"]&.map do |item|
|
41
|
+
item = item.to_json
|
42
|
+
Vapi::TestSuiteRun.from_json(json_object: item)
|
43
|
+
end
|
44
|
+
if parsed_json["metadata"].nil?
|
45
|
+
metadata = nil
|
46
|
+
else
|
47
|
+
metadata = parsed_json["metadata"].to_json
|
48
|
+
metadata = Vapi::PaginationMeta.from_json(json_object: metadata)
|
49
|
+
end
|
50
|
+
new(
|
51
|
+
results: results,
|
52
|
+
metadata: metadata,
|
53
|
+
additional_properties: struct
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Serialize an instance of TestSuiteRunsPaginatedResponse to a JSON object
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
def to_json(*_args)
|
61
|
+
@_field_set&.to_json
|
62
|
+
end
|
63
|
+
|
64
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
65
|
+
# hash and check each fields type against the current object's property
|
66
|
+
# definitions.
|
67
|
+
#
|
68
|
+
# @param obj [Object]
|
69
|
+
# @return [Void]
|
70
|
+
def self.validate_raw(obj:)
|
71
|
+
obj.results.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
|
72
|
+
Vapi::PaginationMeta.validate_raw(obj: obj.metadata)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vapi
|
7
|
+
class TestSuiteTestScorerAi
|
8
|
+
# @return [String] This is the type of the scorer, which must be AI.
|
9
|
+
attr_reader :type
|
10
|
+
# @return [String] This is the rubric used by the AI scorer.
|
11
|
+
attr_reader :rubric
|
12
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
attr_reader :additional_properties
|
14
|
+
# @return [Object]
|
15
|
+
attr_reader :_field_set
|
16
|
+
protected :_field_set
|
17
|
+
|
18
|
+
OMIT = Object.new
|
19
|
+
|
20
|
+
# @param type [String] This is the type of the scorer, which must be AI.
|
21
|
+
# @param rubric [String] This is the rubric used by the AI scorer.
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [Vapi::TestSuiteTestScorerAi]
|
24
|
+
def initialize(type:, rubric:, additional_properties: nil)
|
25
|
+
@type = type
|
26
|
+
@rubric = rubric
|
27
|
+
@additional_properties = additional_properties
|
28
|
+
@_field_set = { "type": type, "rubric": rubric }
|
29
|
+
end
|
30
|
+
|
31
|
+
# Deserialize a JSON object to an instance of TestSuiteTestScorerAi
|
32
|
+
#
|
33
|
+
# @param json_object [String]
|
34
|
+
# @return [Vapi::TestSuiteTestScorerAi]
|
35
|
+
def self.from_json(json_object:)
|
36
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
37
|
+
parsed_json = JSON.parse(json_object)
|
38
|
+
type = parsed_json["type"]
|
39
|
+
rubric = parsed_json["rubric"]
|
40
|
+
new(
|
41
|
+
type: type,
|
42
|
+
rubric: rubric,
|
43
|
+
additional_properties: struct
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Serialize an instance of TestSuiteTestScorerAi to a JSON object
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
def to_json(*_args)
|
51
|
+
@_field_set&.to_json
|
52
|
+
end
|
53
|
+
|
54
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
55
|
+
# hash and check each fields type against the current object's property
|
56
|
+
# definitions.
|
57
|
+
#
|
58
|
+
# @param obj [Object]
|
59
|
+
# @return [Void]
|
60
|
+
def self.validate_raw(obj:)
|
61
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
62
|
+
obj.rubric.is_a?(String) != false || raise("Passed value for field obj.rubric is not the expected type, validation failed.")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_suite_test_scorer_ai"
|
4
|
+
require "date"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class TestSuiteTestVoice
|
10
|
+
# @return [Array<Vapi::TestSuiteTestScorerAi>] These are the scorers used to evaluate the test.
|
11
|
+
attr_reader :scorers
|
12
|
+
# @return [String] This is the unique identifier for the test.
|
13
|
+
attr_reader :id
|
14
|
+
# @return [String] This is the unique identifier for the test suite this test belongs to.
|
15
|
+
attr_reader :test_suite_id
|
16
|
+
# @return [String] This is the unique identifier for the organization this test belongs to.
|
17
|
+
attr_reader :org_id
|
18
|
+
# @return [DateTime] This is the ISO 8601 date-time string of when the test was created.
|
19
|
+
attr_reader :created_at
|
20
|
+
# @return [DateTime] This is the ISO 8601 date-time string of when the test was last updated.
|
21
|
+
attr_reader :updated_at
|
22
|
+
# @return [String] This is the name of the test.
|
23
|
+
attr_reader :name
|
24
|
+
# @return [String] This is the script to be used for the voice test.
|
25
|
+
attr_reader :script
|
26
|
+
# @return [Float] This is the number of attempts allowed for the test.
|
27
|
+
attr_reader :num_attempts
|
28
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
attr_reader :additional_properties
|
30
|
+
# @return [Object]
|
31
|
+
attr_reader :_field_set
|
32
|
+
protected :_field_set
|
33
|
+
|
34
|
+
OMIT = Object.new
|
35
|
+
|
36
|
+
# @param scorers [Array<Vapi::TestSuiteTestScorerAi>] These are the scorers used to evaluate the test.
|
37
|
+
# @param id [String] This is the unique identifier for the test.
|
38
|
+
# @param test_suite_id [String] This is the unique identifier for the test suite this test belongs to.
|
39
|
+
# @param org_id [String] This is the unique identifier for the organization this test belongs to.
|
40
|
+
# @param created_at [DateTime] This is the ISO 8601 date-time string of when the test was created.
|
41
|
+
# @param updated_at [DateTime] This is the ISO 8601 date-time string of when the test was last updated.
|
42
|
+
# @param name [String] This is the name of the test.
|
43
|
+
# @param script [String] This is the script to be used for the voice test.
|
44
|
+
# @param num_attempts [Float] This is the number of attempts allowed for the test.
|
45
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
46
|
+
# @return [Vapi::TestSuiteTestVoice]
|
47
|
+
def initialize(scorers:, id:, test_suite_id:, org_id:, created_at:, updated_at:, script:, name: OMIT,
|
48
|
+
num_attempts: OMIT, additional_properties: nil)
|
49
|
+
@scorers = scorers
|
50
|
+
@id = id
|
51
|
+
@test_suite_id = test_suite_id
|
52
|
+
@org_id = org_id
|
53
|
+
@created_at = created_at
|
54
|
+
@updated_at = updated_at
|
55
|
+
@name = name if name != OMIT
|
56
|
+
@script = script
|
57
|
+
@num_attempts = num_attempts if num_attempts != OMIT
|
58
|
+
@additional_properties = additional_properties
|
59
|
+
@_field_set = {
|
60
|
+
"scorers": scorers,
|
61
|
+
"id": id,
|
62
|
+
"testSuiteId": test_suite_id,
|
63
|
+
"orgId": org_id,
|
64
|
+
"createdAt": created_at,
|
65
|
+
"updatedAt": updated_at,
|
66
|
+
"name": name,
|
67
|
+
"script": script,
|
68
|
+
"numAttempts": num_attempts
|
69
|
+
}.reject do |_k, v|
|
70
|
+
v == OMIT
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Deserialize a JSON object to an instance of TestSuiteTestVoice
|
75
|
+
#
|
76
|
+
# @param json_object [String]
|
77
|
+
# @return [Vapi::TestSuiteTestVoice]
|
78
|
+
def self.from_json(json_object:)
|
79
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
80
|
+
parsed_json = JSON.parse(json_object)
|
81
|
+
scorers = parsed_json["scorers"]&.map do |item|
|
82
|
+
item = item.to_json
|
83
|
+
Vapi::TestSuiteTestScorerAi.from_json(json_object: item)
|
84
|
+
end
|
85
|
+
id = parsed_json["id"]
|
86
|
+
test_suite_id = parsed_json["testSuiteId"]
|
87
|
+
org_id = parsed_json["orgId"]
|
88
|
+
created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
|
89
|
+
updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
|
90
|
+
name = parsed_json["name"]
|
91
|
+
script = parsed_json["script"]
|
92
|
+
num_attempts = parsed_json["numAttempts"]
|
93
|
+
new(
|
94
|
+
scorers: scorers,
|
95
|
+
id: id,
|
96
|
+
test_suite_id: test_suite_id,
|
97
|
+
org_id: org_id,
|
98
|
+
created_at: created_at,
|
99
|
+
updated_at: updated_at,
|
100
|
+
name: name,
|
101
|
+
script: script,
|
102
|
+
num_attempts: num_attempts,
|
103
|
+
additional_properties: struct
|
104
|
+
)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Serialize an instance of TestSuiteTestVoice to a JSON object
|
108
|
+
#
|
109
|
+
# @return [String]
|
110
|
+
def to_json(*_args)
|
111
|
+
@_field_set&.to_json
|
112
|
+
end
|
113
|
+
|
114
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
115
|
+
# hash and check each fields type against the current object's property
|
116
|
+
# definitions.
|
117
|
+
#
|
118
|
+
# @param obj [Object]
|
119
|
+
# @return [Void]
|
120
|
+
def self.validate_raw(obj:)
|
121
|
+
obj.scorers.is_a?(Array) != false || raise("Passed value for field obj.scorers is not the expected type, validation failed.")
|
122
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
123
|
+
obj.test_suite_id.is_a?(String) != false || raise("Passed value for field obj.test_suite_id is not the expected type, validation failed.")
|
124
|
+
obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
|
125
|
+
obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
126
|
+
obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
127
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
128
|
+
obj.script.is_a?(String) != false || raise("Passed value for field obj.script is not the expected type, validation failed.")
|
129
|
+
obj.num_attempts&.is_a?(Float) != false || raise("Passed value for field obj.num_attempts is not the expected type, validation failed.")
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_suite_test_voice"
|
4
|
+
require_relative "pagination_meta"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class TestSuiteTestsPaginatedResponse
|
10
|
+
# @return [Array<Vapi::TestSuiteTestVoice>] A list of test suite tests.
|
11
|
+
attr_reader :results
|
12
|
+
# @return [Vapi::PaginationMeta] Metadata about the pagination.
|
13
|
+
attr_reader :metadata
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param results [Array<Vapi::TestSuiteTestVoice>] A list of test suite tests.
|
23
|
+
# @param metadata [Vapi::PaginationMeta] Metadata about the pagination.
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [Vapi::TestSuiteTestsPaginatedResponse]
|
26
|
+
def initialize(results:, metadata:, additional_properties: nil)
|
27
|
+
@results = results
|
28
|
+
@metadata = metadata
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "results": results, "metadata": metadata }
|
31
|
+
end
|
32
|
+
|
33
|
+
# Deserialize a JSON object to an instance of TestSuiteTestsPaginatedResponse
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [Vapi::TestSuiteTestsPaginatedResponse]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
parsed_json = JSON.parse(json_object)
|
40
|
+
results = parsed_json["results"]&.map do |item|
|
41
|
+
item = item.to_json
|
42
|
+
Vapi::TestSuiteTestVoice.from_json(json_object: item)
|
43
|
+
end
|
44
|
+
if parsed_json["metadata"].nil?
|
45
|
+
metadata = nil
|
46
|
+
else
|
47
|
+
metadata = parsed_json["metadata"].to_json
|
48
|
+
metadata = Vapi::PaginationMeta.from_json(json_object: metadata)
|
49
|
+
end
|
50
|
+
new(
|
51
|
+
results: results,
|
52
|
+
metadata: metadata,
|
53
|
+
additional_properties: struct
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Serialize an instance of TestSuiteTestsPaginatedResponse to a JSON object
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
def to_json(*_args)
|
61
|
+
@_field_set&.to_json
|
62
|
+
end
|
63
|
+
|
64
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
65
|
+
# hash and check each fields type against the current object's property
|
66
|
+
# definitions.
|
67
|
+
#
|
68
|
+
# @param obj [Object]
|
69
|
+
# @return [Void]
|
70
|
+
def self.validate_raw(obj:)
|
71
|
+
obj.results.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
|
72
|
+
Vapi::PaginationMeta.validate_raw(obj: obj.metadata)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "test_suite"
|
4
|
+
require_relative "pagination_meta"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class TestSuitesPaginatedResponse
|
10
|
+
# @return [Array<Vapi::TestSuite>]
|
11
|
+
attr_reader :results
|
12
|
+
# @return [Vapi::PaginationMeta]
|
13
|
+
attr_reader :metadata
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param results [Array<Vapi::TestSuite>]
|
23
|
+
# @param metadata [Vapi::PaginationMeta]
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [Vapi::TestSuitesPaginatedResponse]
|
26
|
+
def initialize(results:, metadata:, additional_properties: nil)
|
27
|
+
@results = results
|
28
|
+
@metadata = metadata
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "results": results, "metadata": metadata }
|
31
|
+
end
|
32
|
+
|
33
|
+
# Deserialize a JSON object to an instance of TestSuitesPaginatedResponse
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [Vapi::TestSuitesPaginatedResponse]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
parsed_json = JSON.parse(json_object)
|
40
|
+
results = parsed_json["results"]&.map do |item|
|
41
|
+
item = item.to_json
|
42
|
+
Vapi::TestSuite.from_json(json_object: item)
|
43
|
+
end
|
44
|
+
if parsed_json["metadata"].nil?
|
45
|
+
metadata = nil
|
46
|
+
else
|
47
|
+
metadata = parsed_json["metadata"].to_json
|
48
|
+
metadata = Vapi::PaginationMeta.from_json(json_object: metadata)
|
49
|
+
end
|
50
|
+
new(
|
51
|
+
results: results,
|
52
|
+
metadata: metadata,
|
53
|
+
additional_properties: struct
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Serialize an instance of TestSuitesPaginatedResponse to a JSON object
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
def to_json(*_args)
|
61
|
+
@_field_set&.to_json
|
62
|
+
end
|
63
|
+
|
64
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
65
|
+
# hash and check each fields type against the current object's property
|
66
|
+
# definitions.
|
67
|
+
#
|
68
|
+
# @param obj [Object]
|
69
|
+
# @return [Void]
|
70
|
+
def self.validate_raw(obj:)
|
71
|
+
obj.results.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
|
72
|
+
Vapi::PaginationMeta.validate_raw(obj: obj.metadata)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -16,6 +16,10 @@ module Vapi
|
|
16
16
|
# be automatically translated to the active language at that moment.
|
17
17
|
# This will override the `content` property.
|
18
18
|
attr_reader :contents
|
19
|
+
# @return [Boolean] This is an optional boolean that if true, the tool call will only trigger after
|
20
|
+
# the message is spoken. Default is false.
|
21
|
+
# @default false
|
22
|
+
attr_reader :blocking
|
19
23
|
# @return [String] This is the content that the assistant says when this message is triggered.
|
20
24
|
attr_reader :content
|
21
25
|
# @return [Array<Vapi::Condition>] This is an optional array of conditions that the tool call arguments must meet
|
@@ -37,17 +41,26 @@ module Vapi
|
|
37
41
|
# - If you don't provide content for a language, the first item in the array will
|
38
42
|
# be automatically translated to the active language at that moment.
|
39
43
|
# This will override the `content` property.
|
44
|
+
# @param blocking [Boolean] This is an optional boolean that if true, the tool call will only trigger after
|
45
|
+
# the message is spoken. Default is false.
|
46
|
+
# @default false
|
40
47
|
# @param content [String] This is the content that the assistant says when this message is triggered.
|
41
48
|
# @param conditions [Array<Vapi::Condition>] This is an optional array of conditions that the tool call arguments must meet
|
42
49
|
# in order for this message to be triggered.
|
43
50
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
44
51
|
# @return [Vapi::ToolMessageStart]
|
45
|
-
def initialize(contents: OMIT, content: OMIT, conditions: OMIT, additional_properties: nil)
|
52
|
+
def initialize(contents: OMIT, blocking: OMIT, content: OMIT, conditions: OMIT, additional_properties: nil)
|
46
53
|
@contents = contents if contents != OMIT
|
54
|
+
@blocking = blocking if blocking != OMIT
|
47
55
|
@content = content if content != OMIT
|
48
56
|
@conditions = conditions if conditions != OMIT
|
49
57
|
@additional_properties = additional_properties
|
50
|
-
@_field_set = {
|
58
|
+
@_field_set = {
|
59
|
+
"contents": contents,
|
60
|
+
"blocking": blocking,
|
61
|
+
"content": content,
|
62
|
+
"conditions": conditions
|
63
|
+
}.reject do |_k, v|
|
51
64
|
v == OMIT
|
52
65
|
end
|
53
66
|
end
|
@@ -63,6 +76,7 @@ module Vapi
|
|
63
76
|
item = item.to_json
|
64
77
|
Vapi::TextContent.from_json(json_object: item)
|
65
78
|
end
|
79
|
+
blocking = parsed_json["blocking"]
|
66
80
|
content = parsed_json["content"]
|
67
81
|
conditions = parsed_json["conditions"]&.map do |item|
|
68
82
|
item = item.to_json
|
@@ -70,6 +84,7 @@ module Vapi
|
|
70
84
|
end
|
71
85
|
new(
|
72
86
|
contents: contents,
|
87
|
+
blocking: blocking,
|
73
88
|
content: content,
|
74
89
|
conditions: conditions,
|
75
90
|
additional_properties: struct
|
@@ -91,6 +106,7 @@ module Vapi
|
|
91
106
|
# @return [Void]
|
92
107
|
def self.validate_raw(obj:)
|
93
108
|
obj.contents&.is_a?(Array) != false || raise("Passed value for field obj.contents is not the expected type, validation failed.")
|
109
|
+
obj.blocking&.is_a?(Boolean) != false || raise("Passed value for field obj.blocking is not the expected type, validation failed.")
|
94
110
|
obj.content&.is_a?(String) != false || raise("Passed value for field obj.content is not the expected type, validation failed.")
|
95
111
|
obj.conditions&.is_a?(Array) != false || raise("Passed value for field obj.conditions is not the expected type, validation failed.")
|
96
112
|
end
|