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
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "format_plan_replacements_item"
|
4
|
+
require_relative "format_plan_formatters_enabled_item"
|
4
5
|
require "ostruct"
|
5
6
|
require "json"
|
6
7
|
|
@@ -35,6 +36,13 @@ module Vapi
|
|
35
36
|
# type. Eg. `{ type: 'regex', regex: '\\b[a-zA-Z]{5}\\b', value: 'hi' }`
|
36
37
|
# @default []
|
37
38
|
attr_reader :replacements
|
39
|
+
# @return [Array<Vapi::FormatPlanFormattersEnabledItem>] List of formatters to apply. If not provided, all default formatters will be
|
40
|
+
# applied.
|
41
|
+
# If provided, only the specified formatters will be applied.
|
42
|
+
# Note: Some essential formatters like angle bracket removal will always be
|
43
|
+
# applied.
|
44
|
+
# @default undefined
|
45
|
+
attr_reader :formatters_enabled
|
38
46
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
39
47
|
attr_reader :additional_properties
|
40
48
|
# @return [Object]
|
@@ -69,17 +77,26 @@ module Vapi
|
|
69
77
|
# - To replace a word or phrase that matches a pattern, use the `RegexReplacement`
|
70
78
|
# type. Eg. `{ type: 'regex', regex: '\\b[a-zA-Z]{5}\\b', value: 'hi' }`
|
71
79
|
# @default []
|
80
|
+
# @param formatters_enabled [Array<Vapi::FormatPlanFormattersEnabledItem>] List of formatters to apply. If not provided, all default formatters will be
|
81
|
+
# applied.
|
82
|
+
# If provided, only the specified formatters will be applied.
|
83
|
+
# Note: Some essential formatters like angle bracket removal will always be
|
84
|
+
# applied.
|
85
|
+
# @default undefined
|
72
86
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
73
87
|
# @return [Vapi::FormatPlan]
|
74
|
-
def initialize(enabled: OMIT, number_to_digits_cutoff: OMIT, replacements: OMIT,
|
88
|
+
def initialize(enabled: OMIT, number_to_digits_cutoff: OMIT, replacements: OMIT, formatters_enabled: OMIT,
|
89
|
+
additional_properties: nil)
|
75
90
|
@enabled = enabled if enabled != OMIT
|
76
91
|
@number_to_digits_cutoff = number_to_digits_cutoff if number_to_digits_cutoff != OMIT
|
77
92
|
@replacements = replacements if replacements != OMIT
|
93
|
+
@formatters_enabled = formatters_enabled if formatters_enabled != OMIT
|
78
94
|
@additional_properties = additional_properties
|
79
95
|
@_field_set = {
|
80
96
|
"enabled": enabled,
|
81
97
|
"numberToDigitsCutoff": number_to_digits_cutoff,
|
82
|
-
"replacements": replacements
|
98
|
+
"replacements": replacements,
|
99
|
+
"formattersEnabled": formatters_enabled
|
83
100
|
}.reject do |_k, v|
|
84
101
|
v == OMIT
|
85
102
|
end
|
@@ -98,10 +115,12 @@ module Vapi
|
|
98
115
|
item = item.to_json
|
99
116
|
Vapi::FormatPlanReplacementsItem.from_json(json_object: item)
|
100
117
|
end
|
118
|
+
formatters_enabled = parsed_json["formattersEnabled"]
|
101
119
|
new(
|
102
120
|
enabled: enabled,
|
103
121
|
number_to_digits_cutoff: number_to_digits_cutoff,
|
104
122
|
replacements: replacements,
|
123
|
+
formatters_enabled: formatters_enabled,
|
105
124
|
additional_properties: struct
|
106
125
|
)
|
107
126
|
end
|
@@ -123,6 +142,7 @@ module Vapi
|
|
123
142
|
obj.enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.enabled is not the expected type, validation failed.")
|
124
143
|
obj.number_to_digits_cutoff&.is_a?(Float) != false || raise("Passed value for field obj.number_to_digits_cutoff is not the expected type, validation failed.")
|
125
144
|
obj.replacements&.is_a?(Array) != false || raise("Passed value for field obj.replacements is not the expected type, validation failed.")
|
145
|
+
obj.formatters_enabled&.is_a?(Array) != false || raise("Passed value for field obj.formatters_enabled is not the expected type, validation failed.")
|
126
146
|
end
|
127
147
|
end
|
128
148
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Vapi
|
4
|
+
class FormatPlanFormattersEnabledItem
|
5
|
+
MARKDOWN = "markdown"
|
6
|
+
ASTERISK = "asterisk"
|
7
|
+
QUOTE = "quote"
|
8
|
+
DASH = "dash"
|
9
|
+
NEWLINE = "newline"
|
10
|
+
COLON = "colon"
|
11
|
+
ACRONYM = "acronym"
|
12
|
+
DOLLAR_AMOUNT = "dollarAmount"
|
13
|
+
EMAIL = "email"
|
14
|
+
DATE = "date"
|
15
|
+
TIME = "time"
|
16
|
+
DISTANCE = "distance"
|
17
|
+
UNIT = "unit"
|
18
|
+
PERCENTAGE = "percentage"
|
19
|
+
PHONE_NUMBER = "phoneNumber"
|
20
|
+
NUMBER = "number"
|
21
|
+
end
|
22
|
+
end
|
@@ -21,8 +21,6 @@ module Vapi
|
|
21
21
|
# `tool.destinations`. For others like the function tool, these can be custom
|
22
22
|
# configured.
|
23
23
|
attr_reader :messages
|
24
|
-
# @return [String] The type of tool. "function" for Function tool.
|
25
|
-
attr_reader :type
|
26
24
|
# @return [Vapi::ToolCall]
|
27
25
|
attr_reader :tool_call
|
28
26
|
# @return [Vapi::OpenAiFunction] This is the function definition of the tool.
|
@@ -60,7 +58,6 @@ module Vapi
|
|
60
58
|
# For some tools, this is auto-filled based on special fields like
|
61
59
|
# `tool.destinations`. For others like the function tool, these can be custom
|
62
60
|
# configured.
|
63
|
-
# @param type [String] The type of tool. "function" for Function tool.
|
64
61
|
# @param tool_call [Vapi::ToolCall]
|
65
62
|
# @param function [Vapi::OpenAiFunction] This is the function definition of the tool.
|
66
63
|
# For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on
|
@@ -79,11 +76,9 @@ module Vapi
|
|
79
76
|
# phoneNumber.serverUrl, then org.serverUrl.
|
80
77
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
81
78
|
# @return [Vapi::FunctionToolWithToolCall]
|
82
|
-
def initialize(
|
83
|
-
additional_properties: nil)
|
79
|
+
def initialize(tool_call:, async: OMIT, messages: OMIT, function: OMIT, server: OMIT, additional_properties: nil)
|
84
80
|
@async = async if async != OMIT
|
85
81
|
@messages = messages if messages != OMIT
|
86
|
-
@type = type
|
87
82
|
@tool_call = tool_call
|
88
83
|
@function = function if function != OMIT
|
89
84
|
@server = server if server != OMIT
|
@@ -91,7 +86,6 @@ module Vapi
|
|
91
86
|
@_field_set = {
|
92
87
|
"async": async,
|
93
88
|
"messages": messages,
|
94
|
-
"type": type,
|
95
89
|
"toolCall": tool_call,
|
96
90
|
"function": function,
|
97
91
|
"server": server
|
@@ -112,7 +106,6 @@ module Vapi
|
|
112
106
|
item = item.to_json
|
113
107
|
Vapi::FunctionToolWithToolCallMessagesItem.from_json(json_object: item)
|
114
108
|
end
|
115
|
-
type = parsed_json["type"]
|
116
109
|
if parsed_json["toolCall"].nil?
|
117
110
|
tool_call = nil
|
118
111
|
else
|
@@ -134,7 +127,6 @@ module Vapi
|
|
134
127
|
new(
|
135
128
|
async: async,
|
136
129
|
messages: messages,
|
137
|
-
type: type,
|
138
130
|
tool_call: tool_call,
|
139
131
|
function: function,
|
140
132
|
server: server,
|
@@ -158,7 +150,6 @@ module Vapi
|
|
158
150
|
def self.validate_raw(obj:)
|
159
151
|
obj.async&.is_a?(Boolean) != false || raise("Passed value for field obj.async is not the expected type, validation failed.")
|
160
152
|
obj.messages&.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.")
|
161
|
-
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
162
153
|
Vapi::ToolCall.validate_raw(obj: obj.tool_call)
|
163
154
|
obj.function.nil? || Vapi::OpenAiFunction.validate_raw(obj: obj.function)
|
164
155
|
obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server)
|
@@ -0,0 +1,143 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "json_schema"
|
4
|
+
require_relative "hook"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class Gather
|
10
|
+
# @return [Vapi::JsonSchema]
|
11
|
+
attr_reader :output
|
12
|
+
# @return [Boolean] This is whether or not the workflow should read back the gathered data to the
|
13
|
+
# user, and ask about its correctness.
|
14
|
+
attr_reader :confirm_content
|
15
|
+
# @return [Array<Vapi::Hook>] This is a list of hooks for a task.
|
16
|
+
# Each hook is a list of tasks to run on a trigger (such as on start, on failure,
|
17
|
+
# etc).
|
18
|
+
# Only Say is supported for now.
|
19
|
+
attr_reader :hooks
|
20
|
+
# @return [Float] This is the number of times we should try to gather the information from the
|
21
|
+
# user before we failover to the fail path. An example of this would be a user
|
22
|
+
# refusing to give their phone number for privacy reasons, and then going down a
|
23
|
+
# different path on account of this
|
24
|
+
attr_reader :max_retries
|
25
|
+
# @return [String] This is a liquid templating string. On the first call to Gather, the template
|
26
|
+
# will be filled out with variables from the context, and will be spoken verbatim
|
27
|
+
# to the user. An example would be "Base on your zipcode, it looks like you could
|
28
|
+
# be in one of these counties: {{ counties | join: ", " }}. Which one do you live
|
29
|
+
# in?"
|
30
|
+
attr_reader :literal_template
|
31
|
+
# @return [String]
|
32
|
+
attr_reader :name
|
33
|
+
# @return [Hash{String => Object}] This is for metadata you want to store on the task.
|
34
|
+
attr_reader :metadata
|
35
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
36
|
+
attr_reader :additional_properties
|
37
|
+
# @return [Object]
|
38
|
+
attr_reader :_field_set
|
39
|
+
protected :_field_set
|
40
|
+
|
41
|
+
OMIT = Object.new
|
42
|
+
|
43
|
+
# @param output [Vapi::JsonSchema]
|
44
|
+
# @param confirm_content [Boolean] This is whether or not the workflow should read back the gathered data to the
|
45
|
+
# user, and ask about its correctness.
|
46
|
+
# @param hooks [Array<Vapi::Hook>] This is a list of hooks for a task.
|
47
|
+
# Each hook is a list of tasks to run on a trigger (such as on start, on failure,
|
48
|
+
# etc).
|
49
|
+
# Only Say is supported for now.
|
50
|
+
# @param max_retries [Float] This is the number of times we should try to gather the information from the
|
51
|
+
# user before we failover to the fail path. An example of this would be a user
|
52
|
+
# refusing to give their phone number for privacy reasons, and then going down a
|
53
|
+
# different path on account of this
|
54
|
+
# @param literal_template [String] This is a liquid templating string. On the first call to Gather, the template
|
55
|
+
# will be filled out with variables from the context, and will be spoken verbatim
|
56
|
+
# to the user. An example would be "Base on your zipcode, it looks like you could
|
57
|
+
# be in one of these counties: {{ counties | join: ", " }}. Which one do you live
|
58
|
+
# in?"
|
59
|
+
# @param name [String]
|
60
|
+
# @param metadata [Hash{String => Object}] This is for metadata you want to store on the task.
|
61
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
62
|
+
# @return [Vapi::Gather]
|
63
|
+
def initialize(output:, name:, confirm_content: OMIT, hooks: OMIT, max_retries: OMIT, literal_template: OMIT,
|
64
|
+
metadata: OMIT, additional_properties: nil)
|
65
|
+
@output = output
|
66
|
+
@confirm_content = confirm_content if confirm_content != OMIT
|
67
|
+
@hooks = hooks if hooks != OMIT
|
68
|
+
@max_retries = max_retries if max_retries != OMIT
|
69
|
+
@literal_template = literal_template if literal_template != OMIT
|
70
|
+
@name = name
|
71
|
+
@metadata = metadata if metadata != OMIT
|
72
|
+
@additional_properties = additional_properties
|
73
|
+
@_field_set = {
|
74
|
+
"output": output,
|
75
|
+
"confirmContent": confirm_content,
|
76
|
+
"hooks": hooks,
|
77
|
+
"maxRetries": max_retries,
|
78
|
+
"literalTemplate": literal_template,
|
79
|
+
"name": name,
|
80
|
+
"metadata": metadata
|
81
|
+
}.reject do |_k, v|
|
82
|
+
v == OMIT
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Deserialize a JSON object to an instance of Gather
|
87
|
+
#
|
88
|
+
# @param json_object [String]
|
89
|
+
# @return [Vapi::Gather]
|
90
|
+
def self.from_json(json_object:)
|
91
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
92
|
+
parsed_json = JSON.parse(json_object)
|
93
|
+
if parsed_json["output"].nil?
|
94
|
+
output = nil
|
95
|
+
else
|
96
|
+
output = parsed_json["output"].to_json
|
97
|
+
output = Vapi::JsonSchema.from_json(json_object: output)
|
98
|
+
end
|
99
|
+
confirm_content = parsed_json["confirmContent"]
|
100
|
+
hooks = parsed_json["hooks"]&.map do |item|
|
101
|
+
item = item.to_json
|
102
|
+
Vapi::Hook.from_json(json_object: item)
|
103
|
+
end
|
104
|
+
max_retries = parsed_json["maxRetries"]
|
105
|
+
literal_template = parsed_json["literalTemplate"]
|
106
|
+
name = parsed_json["name"]
|
107
|
+
metadata = parsed_json["metadata"]
|
108
|
+
new(
|
109
|
+
output: output,
|
110
|
+
confirm_content: confirm_content,
|
111
|
+
hooks: hooks,
|
112
|
+
max_retries: max_retries,
|
113
|
+
literal_template: literal_template,
|
114
|
+
name: name,
|
115
|
+
metadata: metadata,
|
116
|
+
additional_properties: struct
|
117
|
+
)
|
118
|
+
end
|
119
|
+
|
120
|
+
# Serialize an instance of Gather to a JSON object
|
121
|
+
#
|
122
|
+
# @return [String]
|
123
|
+
def to_json(*_args)
|
124
|
+
@_field_set&.to_json
|
125
|
+
end
|
126
|
+
|
127
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
128
|
+
# hash and check each fields type against the current object's property
|
129
|
+
# definitions.
|
130
|
+
#
|
131
|
+
# @param obj [Object]
|
132
|
+
# @return [Void]
|
133
|
+
def self.validate_raw(obj:)
|
134
|
+
Vapi::JsonSchema.validate_raw(obj: obj.output)
|
135
|
+
obj.confirm_content&.is_a?(Boolean) != false || raise("Passed value for field obj.confirm_content is not the expected type, validation failed.")
|
136
|
+
obj.hooks&.is_a?(Array) != false || raise("Passed value for field obj.hooks is not the expected type, validation failed.")
|
137
|
+
obj.max_retries&.is_a?(Float) != false || raise("Passed value for field obj.max_retries is not the expected type, validation failed.")
|
138
|
+
obj.literal_template&.is_a?(String) != false || raise("Passed value for field obj.literal_template is not the expected type, validation failed.")
|
139
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
140
|
+
obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
@@ -22,8 +22,6 @@ module Vapi
|
|
22
22
|
# `tool.destinations`. For others like the function tool, these can be custom
|
23
23
|
# configured.
|
24
24
|
attr_reader :messages
|
25
|
-
# @return [String] The type of tool. "ghl" for GHL tool.
|
26
|
-
attr_reader :type
|
27
25
|
# @return [Vapi::ToolCall]
|
28
26
|
attr_reader :tool_call
|
29
27
|
# @return [Vapi::GhlToolMetadata]
|
@@ -63,7 +61,6 @@ module Vapi
|
|
63
61
|
# For some tools, this is auto-filled based on special fields like
|
64
62
|
# `tool.destinations`. For others like the function tool, these can be custom
|
65
63
|
# configured.
|
66
|
-
# @param type [String] The type of tool. "ghl" for GHL tool.
|
67
64
|
# @param tool_call [Vapi::ToolCall]
|
68
65
|
# @param metadata [Vapi::GhlToolMetadata]
|
69
66
|
# @param function [Vapi::OpenAiFunction] This is the function definition of the tool.
|
@@ -83,11 +80,10 @@ module Vapi
|
|
83
80
|
# phoneNumber.serverUrl, then org.serverUrl.
|
84
81
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
85
82
|
# @return [Vapi::GhlToolWithToolCall]
|
86
|
-
def initialize(
|
83
|
+
def initialize(tool_call:, metadata:, async: OMIT, messages: OMIT, function: OMIT, server: OMIT,
|
87
84
|
additional_properties: nil)
|
88
85
|
@async = async if async != OMIT
|
89
86
|
@messages = messages if messages != OMIT
|
90
|
-
@type = type
|
91
87
|
@tool_call = tool_call
|
92
88
|
@metadata = metadata
|
93
89
|
@function = function if function != OMIT
|
@@ -96,7 +92,6 @@ module Vapi
|
|
96
92
|
@_field_set = {
|
97
93
|
"async": async,
|
98
94
|
"messages": messages,
|
99
|
-
"type": type,
|
100
95
|
"toolCall": tool_call,
|
101
96
|
"metadata": metadata,
|
102
97
|
"function": function,
|
@@ -118,7 +113,6 @@ module Vapi
|
|
118
113
|
item = item.to_json
|
119
114
|
Vapi::GhlToolWithToolCallMessagesItem.from_json(json_object: item)
|
120
115
|
end
|
121
|
-
type = parsed_json["type"]
|
122
116
|
if parsed_json["toolCall"].nil?
|
123
117
|
tool_call = nil
|
124
118
|
else
|
@@ -146,7 +140,6 @@ module Vapi
|
|
146
140
|
new(
|
147
141
|
async: async,
|
148
142
|
messages: messages,
|
149
|
-
type: type,
|
150
143
|
tool_call: tool_call,
|
151
144
|
metadata: metadata,
|
152
145
|
function: function,
|
@@ -171,7 +164,6 @@ module Vapi
|
|
171
164
|
def self.validate_raw(obj:)
|
172
165
|
obj.async&.is_a?(Boolean) != false || raise("Passed value for field obj.async is not the expected type, validation failed.")
|
173
166
|
obj.messages&.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.")
|
174
|
-
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
175
167
|
Vapi::ToolCall.validate_raw(obj: obj.tool_call)
|
176
168
|
Vapi::GhlToolMetadata.validate_raw(obj: obj.metadata)
|
177
169
|
obj.function.nil? || Vapi::OpenAiFunction.validate_raw(obj: obj.function)
|
@@ -3,6 +3,10 @@
|
|
3
3
|
module Vapi
|
4
4
|
# This is the Google model that will be used.
|
5
5
|
class GoogleModelModel
|
6
|
+
GEMINI_20_FLASH_THINKING_EXP = "gemini-2.0-flash-thinking-exp"
|
7
|
+
GEMINI_20_PRO_EXP_0205 = "gemini-2.0-pro-exp-02-05"
|
8
|
+
GEMINI_20_FLASH = "gemini-2.0-flash"
|
9
|
+
GEMINI_20_FLASH_LITE_PREVIEW_0205 = "gemini-2.0-flash-lite-preview-02-05"
|
6
10
|
GEMINI_20_FLASH_EXP = "gemini-2.0-flash-exp"
|
7
11
|
GEMINI_20_FLASH_REALTIME_EXP = "gemini-2.0-flash-realtime-exp"
|
8
12
|
GEMINI_15_FLASH = "gemini-1.5-flash"
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Vapi
|
4
4
|
# This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b
|
5
5
|
class GroqModelModel
|
6
|
+
DEEPSEEK_R_1_DISTILL_LLAMA_70_B = "deepseek-r1-distill-llama-70b"
|
6
7
|
LLAMA_3370_B_VERSATILE = "llama-3.3-70b-versatile"
|
7
8
|
LLAMA_31405_B_REASONING = "llama-3.1-405b-reasoning"
|
8
9
|
LLAMA_3170_B_VERSATILE = "llama-3.1-70b-versatile"
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vapi
|
7
|
+
class Hangup
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :name
|
10
|
+
# @return [Hash{String => Object}] This is for metadata you want to store on the task.
|
11
|
+
attr_reader :metadata
|
12
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
attr_reader :additional_properties
|
14
|
+
# @return [Object]
|
15
|
+
attr_reader :_field_set
|
16
|
+
protected :_field_set
|
17
|
+
|
18
|
+
OMIT = Object.new
|
19
|
+
|
20
|
+
# @param name [String]
|
21
|
+
# @param metadata [Hash{String => Object}] This is for metadata you want to store on the task.
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [Vapi::Hangup]
|
24
|
+
def initialize(name:, metadata: OMIT, additional_properties: nil)
|
25
|
+
@name = name
|
26
|
+
@metadata = metadata if metadata != OMIT
|
27
|
+
@additional_properties = additional_properties
|
28
|
+
@_field_set = { "name": name, "metadata": metadata }.reject do |_k, v|
|
29
|
+
v == OMIT
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Deserialize a JSON object to an instance of Hangup
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [Vapi::Hangup]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
parsed_json = JSON.parse(json_object)
|
40
|
+
name = parsed_json["name"]
|
41
|
+
metadata = parsed_json["metadata"]
|
42
|
+
new(
|
43
|
+
name: name,
|
44
|
+
metadata: metadata,
|
45
|
+
additional_properties: struct
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Serialize an instance of Hangup to a JSON object
|
50
|
+
#
|
51
|
+
# @return [String]
|
52
|
+
def to_json(*_args)
|
53
|
+
@_field_set&.to_json
|
54
|
+
end
|
55
|
+
|
56
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
57
|
+
# hash and check each fields type against the current object's property
|
58
|
+
# definitions.
|
59
|
+
#
|
60
|
+
# @param obj [Object]
|
61
|
+
# @return [Void]
|
62
|
+
def self.validate_raw(obj:)
|
63
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
64
|
+
obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "hook_on"
|
4
|
+
require_relative "say_hook"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class Hook
|
10
|
+
# @return [Vapi::HookOn]
|
11
|
+
attr_reader :on
|
12
|
+
# @return [Array<Vapi::SayHook>]
|
13
|
+
attr_reader :do_
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param on [Vapi::HookOn]
|
23
|
+
# @param do_ [Array<Vapi::SayHook>]
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [Vapi::Hook]
|
26
|
+
def initialize(on:, do_:, additional_properties: nil)
|
27
|
+
@on = on
|
28
|
+
@do_ = do_
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "on": on, "do": do_ }
|
31
|
+
end
|
32
|
+
|
33
|
+
# Deserialize a JSON object to an instance of Hook
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [Vapi::Hook]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
parsed_json = JSON.parse(json_object)
|
40
|
+
on = parsed_json["on"]
|
41
|
+
do_ = parsed_json["do"]&.map do |item|
|
42
|
+
item = item.to_json
|
43
|
+
Vapi::SayHook.from_json(json_object: item)
|
44
|
+
end
|
45
|
+
new(
|
46
|
+
on: on,
|
47
|
+
do_: do_,
|
48
|
+
additional_properties: struct
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Serialize an instance of Hook to a JSON object
|
53
|
+
#
|
54
|
+
# @return [String]
|
55
|
+
def to_json(*_args)
|
56
|
+
@_field_set&.to_json
|
57
|
+
end
|
58
|
+
|
59
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
60
|
+
# hash and check each fields type against the current object's property
|
61
|
+
# definitions.
|
62
|
+
#
|
63
|
+
# @param obj [Object]
|
64
|
+
# @return [Void]
|
65
|
+
def self.validate_raw(obj:)
|
66
|
+
obj.on.is_a?(Vapi::HookOn) != false || raise("Passed value for field obj.on is not the expected type, validation failed.")
|
67
|
+
obj.do_.is_a?(Array) != false || raise("Passed value for field obj.do_ is not the expected type, validation failed.")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -10,6 +10,8 @@ module Vapi
|
|
10
10
|
attr_reader :emails
|
11
11
|
# @return [Vapi::InviteUserDtoRole]
|
12
12
|
attr_reader :role
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :redirect_to
|
13
15
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
16
|
attr_reader :additional_properties
|
15
17
|
# @return [Object]
|
@@ -20,13 +22,17 @@ module Vapi
|
|
20
22
|
|
21
23
|
# @param emails [Array<String>]
|
22
24
|
# @param role [Vapi::InviteUserDtoRole]
|
25
|
+
# @param redirect_to [String]
|
23
26
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
24
27
|
# @return [Vapi::InviteUserDto]
|
25
|
-
def initialize(emails:, role:, additional_properties: nil)
|
28
|
+
def initialize(emails:, role:, redirect_to: OMIT, additional_properties: nil)
|
26
29
|
@emails = emails
|
27
30
|
@role = role
|
31
|
+
@redirect_to = redirect_to if redirect_to != OMIT
|
28
32
|
@additional_properties = additional_properties
|
29
|
-
@_field_set = { "emails": emails, "role": role }
|
33
|
+
@_field_set = { "emails": emails, "role": role, "redirectTo": redirect_to }.reject do |_k, v|
|
34
|
+
v == OMIT
|
35
|
+
end
|
30
36
|
end
|
31
37
|
|
32
38
|
# Deserialize a JSON object to an instance of InviteUserDto
|
@@ -38,9 +44,11 @@ module Vapi
|
|
38
44
|
parsed_json = JSON.parse(json_object)
|
39
45
|
emails = parsed_json["emails"]
|
40
46
|
role = parsed_json["role"]
|
47
|
+
redirect_to = parsed_json["redirectTo"]
|
41
48
|
new(
|
42
49
|
emails: emails,
|
43
50
|
role: role,
|
51
|
+
redirect_to: redirect_to,
|
44
52
|
additional_properties: struct
|
45
53
|
)
|
46
54
|
end
|
@@ -61,6 +69,7 @@ module Vapi
|
|
61
69
|
def self.validate_raw(obj:)
|
62
70
|
obj.emails.is_a?(Array) != false || raise("Passed value for field obj.emails is not the expected type, validation failed.")
|
63
71
|
obj.role.is_a?(Vapi::InviteUserDtoRole) != false || raise("Passed value for field obj.role is not the expected type, validation failed.")
|
72
|
+
obj.redirect_to&.is_a?(String) != false || raise("Passed value for field obj.redirect_to is not the expected type, validation failed.")
|
64
73
|
end
|
65
74
|
end
|
66
75
|
end
|
@@ -31,6 +31,15 @@ module Vapi
|
|
31
31
|
# @return [Array<String>] This is a list of properties that are required.
|
32
32
|
# This only makes sense if the type is "object".
|
33
33
|
attr_reader :required
|
34
|
+
# @return [String] This is a regex that will be used to validate data in question.
|
35
|
+
attr_reader :regex
|
36
|
+
# @return [String] This the value that will be used in filling the property.
|
37
|
+
attr_reader :value
|
38
|
+
# @return [String] This the target variable that will be filled with the value of this property.
|
39
|
+
attr_reader :target
|
40
|
+
# @return [Array<String>] This array specifies the allowed values that can be used to restrict the output
|
41
|
+
# of the model.
|
42
|
+
attr_reader :enum
|
34
43
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
35
44
|
attr_reader :additional_properties
|
36
45
|
# @return [Object]
|
@@ -59,21 +68,35 @@ module Vapi
|
|
59
68
|
# @param description [String] This is the description to help the model understand what it needs to output.
|
60
69
|
# @param required [Array<String>] This is a list of properties that are required.
|
61
70
|
# This only makes sense if the type is "object".
|
71
|
+
# @param regex [String] This is a regex that will be used to validate data in question.
|
72
|
+
# @param value [String] This the value that will be used in filling the property.
|
73
|
+
# @param target [String] This the target variable that will be filled with the value of this property.
|
74
|
+
# @param enum [Array<String>] This array specifies the allowed values that can be used to restrict the output
|
75
|
+
# of the model.
|
62
76
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
63
77
|
# @return [Vapi::JsonSchema]
|
64
|
-
def initialize(type:, items: OMIT, properties: OMIT, description: OMIT, required: OMIT,
|
78
|
+
def initialize(type:, items: OMIT, properties: OMIT, description: OMIT, required: OMIT, regex: OMIT, value: OMIT,
|
79
|
+
target: OMIT, enum: OMIT, additional_properties: nil)
|
65
80
|
@type = type
|
66
81
|
@items = items if items != OMIT
|
67
82
|
@properties = properties if properties != OMIT
|
68
83
|
@description = description if description != OMIT
|
69
84
|
@required = required if required != OMIT
|
85
|
+
@regex = regex if regex != OMIT
|
86
|
+
@value = value if value != OMIT
|
87
|
+
@target = target if target != OMIT
|
88
|
+
@enum = enum if enum != OMIT
|
70
89
|
@additional_properties = additional_properties
|
71
90
|
@_field_set = {
|
72
91
|
"type": type,
|
73
92
|
"items": items,
|
74
93
|
"properties": properties,
|
75
94
|
"description": description,
|
76
|
-
"required": required
|
95
|
+
"required": required,
|
96
|
+
"regex": regex,
|
97
|
+
"value": value,
|
98
|
+
"target": target,
|
99
|
+
"enum": enum
|
77
100
|
}.reject do |_k, v|
|
78
101
|
v == OMIT
|
79
102
|
end
|
@@ -91,12 +114,20 @@ module Vapi
|
|
91
114
|
properties = parsed_json["properties"]
|
92
115
|
description = parsed_json["description"]
|
93
116
|
required = parsed_json["required"]
|
117
|
+
regex = parsed_json["regex"]
|
118
|
+
value = parsed_json["value"]
|
119
|
+
target = parsed_json["target"]
|
120
|
+
enum = parsed_json["enum"]
|
94
121
|
new(
|
95
122
|
type: type,
|
96
123
|
items: items,
|
97
124
|
properties: properties,
|
98
125
|
description: description,
|
99
126
|
required: required,
|
127
|
+
regex: regex,
|
128
|
+
value: value,
|
129
|
+
target: target,
|
130
|
+
enum: enum,
|
100
131
|
additional_properties: struct
|
101
132
|
)
|
102
133
|
end
|
@@ -120,6 +151,10 @@ module Vapi
|
|
120
151
|
obj.properties&.is_a?(Hash) != false || raise("Passed value for field obj.properties is not the expected type, validation failed.")
|
121
152
|
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
122
153
|
obj.required&.is_a?(Array) != false || raise("Passed value for field obj.required is not the expected type, validation failed.")
|
154
|
+
obj.regex&.is_a?(String) != false || raise("Passed value for field obj.regex is not the expected type, validation failed.")
|
155
|
+
obj.value&.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
156
|
+
obj.target&.is_a?(String) != false || raise("Passed value for field obj.target is not the expected type, validation failed.")
|
157
|
+
obj.enum&.is_a?(Array) != false || raise("Passed value for field obj.enum is not the expected type, validation failed.")
|
123
158
|
end
|
124
159
|
end
|
125
160
|
end
|