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
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Vapi
|
7
|
+
class BackoffPlan
|
8
|
+
# @return [Float] This is the maximum number of retries to attempt if the request fails. Defaults
|
9
|
+
# to 0 (no retries).
|
10
|
+
# @default 0
|
11
|
+
attr_reader :max_retries
|
12
|
+
# @return [Hash{String => Object}] This is the type of backoff plan to use. Defaults to fixed.
|
13
|
+
# @default fixed
|
14
|
+
attr_reader :type
|
15
|
+
# @return [Float] This is the base delay in seconds. For linear backoff, this is the delay between
|
16
|
+
# each retry. For exponential backoff, this is the initial delay.
|
17
|
+
attr_reader :base_delay_seconds
|
18
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
attr_reader :additional_properties
|
20
|
+
# @return [Object]
|
21
|
+
attr_reader :_field_set
|
22
|
+
protected :_field_set
|
23
|
+
|
24
|
+
OMIT = Object.new
|
25
|
+
|
26
|
+
# @param max_retries [Float] This is the maximum number of retries to attempt if the request fails. Defaults
|
27
|
+
# to 0 (no retries).
|
28
|
+
# @default 0
|
29
|
+
# @param type [Hash{String => Object}] This is the type of backoff plan to use. Defaults to fixed.
|
30
|
+
# @default fixed
|
31
|
+
# @param base_delay_seconds [Float] This is the base delay in seconds. For linear backoff, this is the delay between
|
32
|
+
# each retry. For exponential backoff, this is the initial delay.
|
33
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
34
|
+
# @return [Vapi::BackoffPlan]
|
35
|
+
def initialize(max_retries:, type:, base_delay_seconds:, additional_properties: nil)
|
36
|
+
@max_retries = max_retries
|
37
|
+
@type = type
|
38
|
+
@base_delay_seconds = base_delay_seconds
|
39
|
+
@additional_properties = additional_properties
|
40
|
+
@_field_set = { "maxRetries": max_retries, "type": type, "baseDelaySeconds": base_delay_seconds }
|
41
|
+
end
|
42
|
+
|
43
|
+
# Deserialize a JSON object to an instance of BackoffPlan
|
44
|
+
#
|
45
|
+
# @param json_object [String]
|
46
|
+
# @return [Vapi::BackoffPlan]
|
47
|
+
def self.from_json(json_object:)
|
48
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
49
|
+
parsed_json = JSON.parse(json_object)
|
50
|
+
max_retries = parsed_json["maxRetries"]
|
51
|
+
type = parsed_json["type"]
|
52
|
+
base_delay_seconds = parsed_json["baseDelaySeconds"]
|
53
|
+
new(
|
54
|
+
max_retries: max_retries,
|
55
|
+
type: type,
|
56
|
+
base_delay_seconds: base_delay_seconds,
|
57
|
+
additional_properties: struct
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Serialize an instance of BackoffPlan to a JSON object
|
62
|
+
#
|
63
|
+
# @return [String]
|
64
|
+
def to_json(*_args)
|
65
|
+
@_field_set&.to_json
|
66
|
+
end
|
67
|
+
|
68
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
69
|
+
# hash and check each fields type against the current object's property
|
70
|
+
# definitions.
|
71
|
+
#
|
72
|
+
# @param obj [Object]
|
73
|
+
# @return [Void]
|
74
|
+
def self.validate_raw(obj:)
|
75
|
+
obj.max_retries.is_a?(Float) != false || raise("Passed value for field obj.max_retries is not the expected type, validation failed.")
|
76
|
+
obj.type.is_a?(Hash) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
77
|
+
obj.base_delay_seconds.is_a?(Float) != false || raise("Passed value for field obj.base_delay_seconds is not the expected type, validation failed.")
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,175 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "bash_tool_with_tool_call_messages_item"
|
4
|
+
require_relative "tool_call"
|
5
|
+
require_relative "open_ai_function"
|
6
|
+
require_relative "server"
|
7
|
+
require "ostruct"
|
8
|
+
require "json"
|
9
|
+
|
10
|
+
module Vapi
|
11
|
+
class BashToolWithToolCall
|
12
|
+
# @return [Boolean] This determines if the tool is async.
|
13
|
+
# If async, the assistant will move forward without waiting for your server to
|
14
|
+
# respond. This is useful if you just want to trigger something on your server.
|
15
|
+
# If sync, the assistant will wait for your server to respond. This is useful if
|
16
|
+
# want assistant to respond with the result from your server.
|
17
|
+
# Defaults to synchronous (`false`).
|
18
|
+
attr_reader :async
|
19
|
+
# @return [Array<Vapi::BashToolWithToolCallMessagesItem>] These are the messages that will be spoken to the user as the tool is running.
|
20
|
+
# For some tools, this is auto-filled based on special fields like
|
21
|
+
# `tool.destinations`. For others like the function tool, these can be custom
|
22
|
+
# configured.
|
23
|
+
attr_reader :messages
|
24
|
+
# @return [String] The sub type of tool.
|
25
|
+
attr_reader :sub_type
|
26
|
+
# @return [Vapi::ToolCall]
|
27
|
+
attr_reader :tool_call
|
28
|
+
# @return [String] The name of the tool, fixed to 'bash'
|
29
|
+
attr_reader :name
|
30
|
+
# @return [Vapi::OpenAiFunction] This is the function definition of the tool.
|
31
|
+
# For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on
|
32
|
+
# tool-specific fields like `tool.destinations`. But, even in those cases, you can
|
33
|
+
# provide a custom function definition for advanced use cases.
|
34
|
+
# An example of an advanced use case is if you want to customize the message
|
35
|
+
# that's spoken for `endCall` tool. You can specify a function where it returns an
|
36
|
+
# argument "reason". Then, in `messages` array, you can have many
|
37
|
+
# "request-complete" messages. One of these messages will be triggered if the
|
38
|
+
# `messages[].conditions` matches the "reason" argument.
|
39
|
+
attr_reader :function
|
40
|
+
# @return [Vapi::Server] This is the server that will be hit when this tool is requested by the model.
|
41
|
+
# All requests will be sent with the call object among other things. You can find
|
42
|
+
# more details in the Server URL documentation.
|
43
|
+
# This overrides the serverUrl set on the org and the phoneNumber. Order of
|
44
|
+
# precedence: highest tool.server.url, then assistant.serverUrl, then
|
45
|
+
# phoneNumber.serverUrl, then org.serverUrl.
|
46
|
+
attr_reader :server
|
47
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
48
|
+
attr_reader :additional_properties
|
49
|
+
# @return [Object]
|
50
|
+
attr_reader :_field_set
|
51
|
+
protected :_field_set
|
52
|
+
|
53
|
+
OMIT = Object.new
|
54
|
+
|
55
|
+
# @param async [Boolean] This determines if the tool is async.
|
56
|
+
# If async, the assistant will move forward without waiting for your server to
|
57
|
+
# respond. This is useful if you just want to trigger something on your server.
|
58
|
+
# If sync, the assistant will wait for your server to respond. This is useful if
|
59
|
+
# want assistant to respond with the result from your server.
|
60
|
+
# Defaults to synchronous (`false`).
|
61
|
+
# @param messages [Array<Vapi::BashToolWithToolCallMessagesItem>] These are the messages that will be spoken to the user as the tool is running.
|
62
|
+
# For some tools, this is auto-filled based on special fields like
|
63
|
+
# `tool.destinations`. For others like the function tool, these can be custom
|
64
|
+
# configured.
|
65
|
+
# @param sub_type [String] The sub type of tool.
|
66
|
+
# @param tool_call [Vapi::ToolCall]
|
67
|
+
# @param name [String] The name of the tool, fixed to 'bash'
|
68
|
+
# @param function [Vapi::OpenAiFunction] This is the function definition of the tool.
|
69
|
+
# For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on
|
70
|
+
# tool-specific fields like `tool.destinations`. But, even in those cases, you can
|
71
|
+
# provide a custom function definition for advanced use cases.
|
72
|
+
# An example of an advanced use case is if you want to customize the message
|
73
|
+
# that's spoken for `endCall` tool. You can specify a function where it returns an
|
74
|
+
# argument "reason". Then, in `messages` array, you can have many
|
75
|
+
# "request-complete" messages. One of these messages will be triggered if the
|
76
|
+
# `messages[].conditions` matches the "reason" argument.
|
77
|
+
# @param server [Vapi::Server] This is the server that will be hit when this tool is requested by the model.
|
78
|
+
# All requests will be sent with the call object among other things. You can find
|
79
|
+
# more details in the Server URL documentation.
|
80
|
+
# This overrides the serverUrl set on the org and the phoneNumber. Order of
|
81
|
+
# precedence: highest tool.server.url, then assistant.serverUrl, then
|
82
|
+
# phoneNumber.serverUrl, then org.serverUrl.
|
83
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
84
|
+
# @return [Vapi::BashToolWithToolCall]
|
85
|
+
def initialize(sub_type:, tool_call:, name:, async: OMIT, messages: OMIT, function: OMIT, server: OMIT,
|
86
|
+
additional_properties: nil)
|
87
|
+
@async = async if async != OMIT
|
88
|
+
@messages = messages if messages != OMIT
|
89
|
+
@sub_type = sub_type
|
90
|
+
@tool_call = tool_call
|
91
|
+
@name = name
|
92
|
+
@function = function if function != OMIT
|
93
|
+
@server = server if server != OMIT
|
94
|
+
@additional_properties = additional_properties
|
95
|
+
@_field_set = {
|
96
|
+
"async": async,
|
97
|
+
"messages": messages,
|
98
|
+
"subType": sub_type,
|
99
|
+
"toolCall": tool_call,
|
100
|
+
"name": name,
|
101
|
+
"function": function,
|
102
|
+
"server": server
|
103
|
+
}.reject do |_k, v|
|
104
|
+
v == OMIT
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Deserialize a JSON object to an instance of BashToolWithToolCall
|
109
|
+
#
|
110
|
+
# @param json_object [String]
|
111
|
+
# @return [Vapi::BashToolWithToolCall]
|
112
|
+
def self.from_json(json_object:)
|
113
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
114
|
+
parsed_json = JSON.parse(json_object)
|
115
|
+
async = parsed_json["async"]
|
116
|
+
messages = parsed_json["messages"]&.map do |item|
|
117
|
+
item = item.to_json
|
118
|
+
Vapi::BashToolWithToolCallMessagesItem.from_json(json_object: item)
|
119
|
+
end
|
120
|
+
sub_type = parsed_json["subType"]
|
121
|
+
if parsed_json["toolCall"].nil?
|
122
|
+
tool_call = nil
|
123
|
+
else
|
124
|
+
tool_call = parsed_json["toolCall"].to_json
|
125
|
+
tool_call = Vapi::ToolCall.from_json(json_object: tool_call)
|
126
|
+
end
|
127
|
+
name = parsed_json["name"]
|
128
|
+
if parsed_json["function"].nil?
|
129
|
+
function = nil
|
130
|
+
else
|
131
|
+
function = parsed_json["function"].to_json
|
132
|
+
function = Vapi::OpenAiFunction.from_json(json_object: function)
|
133
|
+
end
|
134
|
+
if parsed_json["server"].nil?
|
135
|
+
server = nil
|
136
|
+
else
|
137
|
+
server = parsed_json["server"].to_json
|
138
|
+
server = Vapi::Server.from_json(json_object: server)
|
139
|
+
end
|
140
|
+
new(
|
141
|
+
async: async,
|
142
|
+
messages: messages,
|
143
|
+
sub_type: sub_type,
|
144
|
+
tool_call: tool_call,
|
145
|
+
name: name,
|
146
|
+
function: function,
|
147
|
+
server: server,
|
148
|
+
additional_properties: struct
|
149
|
+
)
|
150
|
+
end
|
151
|
+
|
152
|
+
# Serialize an instance of BashToolWithToolCall to a JSON object
|
153
|
+
#
|
154
|
+
# @return [String]
|
155
|
+
def to_json(*_args)
|
156
|
+
@_field_set&.to_json
|
157
|
+
end
|
158
|
+
|
159
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
160
|
+
# hash and check each fields type against the current object's property
|
161
|
+
# definitions.
|
162
|
+
#
|
163
|
+
# @param obj [Object]
|
164
|
+
# @return [Void]
|
165
|
+
def self.validate_raw(obj:)
|
166
|
+
obj.async&.is_a?(Boolean) != false || raise("Passed value for field obj.async is not the expected type, validation failed.")
|
167
|
+
obj.messages&.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.")
|
168
|
+
obj.sub_type.is_a?(String) != false || raise("Passed value for field obj.sub_type is not the expected type, validation failed.")
|
169
|
+
Vapi::ToolCall.validate_raw(obj: obj.tool_call)
|
170
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
171
|
+
obj.function.nil? || Vapi::OpenAiFunction.validate_raw(obj: obj.function)
|
172
|
+
obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "tool_message_start"
|
5
|
+
require_relative "tool_message_complete"
|
6
|
+
require_relative "tool_message_failed"
|
7
|
+
require_relative "tool_message_delayed"
|
8
|
+
|
9
|
+
module Vapi
|
10
|
+
class BashToolWithToolCallMessagesItem
|
11
|
+
# @return [Object]
|
12
|
+
attr_reader :member
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :discriminant
|
15
|
+
|
16
|
+
private_class_method :new
|
17
|
+
alias kind_of? is_a?
|
18
|
+
|
19
|
+
# @param member [Object]
|
20
|
+
# @param discriminant [String]
|
21
|
+
# @return [Vapi::BashToolWithToolCallMessagesItem]
|
22
|
+
def initialize(member:, discriminant:)
|
23
|
+
@member = member
|
24
|
+
@discriminant = discriminant
|
25
|
+
end
|
26
|
+
|
27
|
+
# Deserialize a JSON object to an instance of BashToolWithToolCallMessagesItem
|
28
|
+
#
|
29
|
+
# @param json_object [String]
|
30
|
+
# @return [Vapi::BashToolWithToolCallMessagesItem]
|
31
|
+
def self.from_json(json_object:)
|
32
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
33
|
+
member = case struct.type
|
34
|
+
when "request-start"
|
35
|
+
Vapi::ToolMessageStart.from_json(json_object: json_object)
|
36
|
+
when "request-complete"
|
37
|
+
Vapi::ToolMessageComplete.from_json(json_object: json_object)
|
38
|
+
when "request-failed"
|
39
|
+
Vapi::ToolMessageFailed.from_json(json_object: json_object)
|
40
|
+
when "request-response-delayed"
|
41
|
+
Vapi::ToolMessageDelayed.from_json(json_object: json_object)
|
42
|
+
else
|
43
|
+
Vapi::ToolMessageStart.from_json(json_object: json_object)
|
44
|
+
end
|
45
|
+
new(member: member, discriminant: struct.type)
|
46
|
+
end
|
47
|
+
|
48
|
+
# For Union Types, to_json functionality is delegated to the wrapped member.
|
49
|
+
#
|
50
|
+
# @return [String]
|
51
|
+
def to_json(*_args)
|
52
|
+
case @discriminant
|
53
|
+
when "request-start"
|
54
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
55
|
+
when "request-complete"
|
56
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
57
|
+
when "request-failed"
|
58
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
59
|
+
when "request-response-delayed"
|
60
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
61
|
+
else
|
62
|
+
{ "type": @discriminant, value: @member }.to_json
|
63
|
+
end
|
64
|
+
@member.to_json
|
65
|
+
end
|
66
|
+
|
67
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
68
|
+
# hash and check each fields type against the current object's property
|
69
|
+
# definitions.
|
70
|
+
#
|
71
|
+
# @param obj [Object]
|
72
|
+
# @return [Void]
|
73
|
+
def self.validate_raw(obj:)
|
74
|
+
case obj.type
|
75
|
+
when "request-start"
|
76
|
+
Vapi::ToolMessageStart.validate_raw(obj: obj)
|
77
|
+
when "request-complete"
|
78
|
+
Vapi::ToolMessageComplete.validate_raw(obj: obj)
|
79
|
+
when "request-failed"
|
80
|
+
Vapi::ToolMessageFailed.validate_raw(obj: obj)
|
81
|
+
when "request-response-delayed"
|
82
|
+
Vapi::ToolMessageDelayed.validate_raw(obj: obj)
|
83
|
+
else
|
84
|
+
raise("Passed value matched no type within the union, validation failed.")
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# For Union Types, is_a? functionality is delegated to the wrapped member.
|
89
|
+
#
|
90
|
+
# @param obj [Object]
|
91
|
+
# @return [Boolean]
|
92
|
+
def is_a?(obj)
|
93
|
+
@member.is_a?(obj)
|
94
|
+
end
|
95
|
+
|
96
|
+
# @param member [Vapi::ToolMessageStart]
|
97
|
+
# @return [Vapi::BashToolWithToolCallMessagesItem]
|
98
|
+
def self.request_start(member:)
|
99
|
+
new(member: member, discriminant: "request-start")
|
100
|
+
end
|
101
|
+
|
102
|
+
# @param member [Vapi::ToolMessageComplete]
|
103
|
+
# @return [Vapi::BashToolWithToolCallMessagesItem]
|
104
|
+
def self.request_complete(member:)
|
105
|
+
new(member: member, discriminant: "request-complete")
|
106
|
+
end
|
107
|
+
|
108
|
+
# @param member [Vapi::ToolMessageFailed]
|
109
|
+
# @return [Vapi::BashToolWithToolCallMessagesItem]
|
110
|
+
def self.request_failed(member:)
|
111
|
+
new(member: member, discriminant: "request-failed")
|
112
|
+
end
|
113
|
+
|
114
|
+
# @param member [Vapi::ToolMessageDelayed]
|
115
|
+
# @return [Vapi::BashToolWithToolCallMessagesItem]
|
116
|
+
def self.request_response_delayed(member:)
|
117
|
+
new(member: member, discriminant: "request-response-delayed")
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "byo_phone_number_fallback_destination"
|
4
4
|
require "date"
|
5
|
+
require_relative "byo_phone_number_status"
|
5
6
|
require_relative "server"
|
6
7
|
require "ostruct"
|
7
8
|
require "json"
|
@@ -34,6 +35,8 @@ module Vapi
|
|
34
35
|
attr_reader :created_at
|
35
36
|
# @return [DateTime] This is the ISO 8601 date-time string of when the phone number was last updated.
|
36
37
|
attr_reader :updated_at
|
38
|
+
# @return [Vapi::ByoPhoneNumberStatus] This is the status of the phone number.
|
39
|
+
attr_reader :status
|
37
40
|
# @return [String] This is the name of the phone number. This is just for your own reference.
|
38
41
|
attr_reader :name
|
39
42
|
# @return [String] This is the assistant that will be used for incoming calls to this phone number.
|
@@ -88,6 +91,7 @@ module Vapi
|
|
88
91
|
# @param org_id [String] This is the unique identifier for the org that this phone number belongs to.
|
89
92
|
# @param created_at [DateTime] This is the ISO 8601 date-time string of when the phone number was created.
|
90
93
|
# @param updated_at [DateTime] This is the ISO 8601 date-time string of when the phone number was last updated.
|
94
|
+
# @param status [Vapi::ByoPhoneNumberStatus] This is the status of the phone number.
|
91
95
|
# @param name [String] This is the name of the phone number. This is just for your own reference.
|
92
96
|
# @param assistant_id [String] This is the assistant that will be used for incoming calls to this phone number.
|
93
97
|
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
@@ -111,13 +115,14 @@ module Vapi
|
|
111
115
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
112
116
|
# @return [Vapi::ByoPhoneNumber]
|
113
117
|
def initialize(id:, org_id:, created_at:, updated_at:, credential_id:, fallback_destination: OMIT,
|
114
|
-
number_e_164_check_enabled: OMIT, name: OMIT, assistant_id: OMIT, squad_id: OMIT, server: OMIT, number: OMIT, additional_properties: nil)
|
118
|
+
number_e_164_check_enabled: OMIT, status: OMIT, name: OMIT, assistant_id: OMIT, squad_id: OMIT, server: OMIT, number: OMIT, additional_properties: nil)
|
115
119
|
@fallback_destination = fallback_destination if fallback_destination != OMIT
|
116
120
|
@number_e_164_check_enabled = number_e_164_check_enabled if number_e_164_check_enabled != OMIT
|
117
121
|
@id = id
|
118
122
|
@org_id = org_id
|
119
123
|
@created_at = created_at
|
120
124
|
@updated_at = updated_at
|
125
|
+
@status = status if status != OMIT
|
121
126
|
@name = name if name != OMIT
|
122
127
|
@assistant_id = assistant_id if assistant_id != OMIT
|
123
128
|
@squad_id = squad_id if squad_id != OMIT
|
@@ -132,6 +137,7 @@ module Vapi
|
|
132
137
|
"orgId": org_id,
|
133
138
|
"createdAt": created_at,
|
134
139
|
"updatedAt": updated_at,
|
140
|
+
"status": status,
|
135
141
|
"name": name,
|
136
142
|
"assistantId": assistant_id,
|
137
143
|
"squadId": squad_id,
|
@@ -161,6 +167,7 @@ module Vapi
|
|
161
167
|
org_id = parsed_json["orgId"]
|
162
168
|
created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
|
163
169
|
updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
|
170
|
+
status = parsed_json["status"]
|
164
171
|
name = parsed_json["name"]
|
165
172
|
assistant_id = parsed_json["assistantId"]
|
166
173
|
squad_id = parsed_json["squadId"]
|
@@ -179,6 +186,7 @@ module Vapi
|
|
179
186
|
org_id: org_id,
|
180
187
|
created_at: created_at,
|
181
188
|
updated_at: updated_at,
|
189
|
+
status: status,
|
182
190
|
name: name,
|
183
191
|
assistant_id: assistant_id,
|
184
192
|
squad_id: squad_id,
|
@@ -209,6 +217,7 @@ module Vapi
|
|
209
217
|
obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
|
210
218
|
obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
211
219
|
obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
220
|
+
obj.status&.is_a?(Vapi::ByoPhoneNumberStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
212
221
|
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
213
222
|
obj.assistant_id&.is_a?(String) != false || raise("Passed value for field obj.assistant_id is not the expected type, validation failed.")
|
214
223
|
obj.squad_id&.is_a?(String) != false || raise("Passed value for field obj.squad_id is not the expected type, validation failed.")
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Vapi
|
4
4
|
# This is the explanation for how the call ended.
|
5
5
|
class CallEndedReason
|
6
|
-
|
6
|
+
ASSISTANT_NOT_VALID = "assistant-not-valid"
|
7
7
|
ASSISTANT_NOT_PROVIDED = "assistant-not-provided"
|
8
8
|
CALL_START_ERROR_NEITHER_ASSISTANT_NOR_SERVER_SET = "call-start-error-neither-assistant-nor-server-set"
|
9
9
|
ASSISTANT_REQUEST_FAILED = "assistant-request-failed"
|
@@ -14,6 +14,7 @@ module Vapi
|
|
14
14
|
ASSISTANT_REQUEST_RETURNED_FORWARDING_PHONE_NUMBER = "assistant-request-returned-forwarding-phone-number"
|
15
15
|
ASSISTANT_ENDED_CALL = "assistant-ended-call"
|
16
16
|
ASSISTANT_SAID_END_CALL_PHRASE = "assistant-said-end-call-phrase"
|
17
|
+
ASSISTANT_ENDED_CALL_WITH_HANGUP_TASK = "assistant-ended-call-with-hangup-task"
|
17
18
|
ASSISTANT_FORWARDED_CALL = "assistant-forwarded-call"
|
18
19
|
ASSISTANT_JOIN_TIMED_OUT = "assistant-join-timed-out"
|
19
20
|
CUSTOMER_BUSY = "customer-busy"
|
@@ -37,8 +38,10 @@ module Vapi
|
|
37
38
|
PIPELINE_ERROR_RIME_AI_VOICE_FAILED = "pipeline-error-rime-ai-voice-failed"
|
38
39
|
PIPELINE_ERROR_NEETS_VOICE_FAILED = "pipeline-error-neets-voice-failed"
|
39
40
|
PIPELINE_ERROR_SMALLEST_AI_VOICE_FAILED = "pipeline-error-smallest-ai-voice-failed"
|
41
|
+
PIPELINE_ERROR_NEUPHONIC_VOICE_FAILED = "pipeline-error-neuphonic-voice-failed"
|
40
42
|
PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED = "pipeline-error-deepgram-transcriber-failed"
|
41
43
|
PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED = "pipeline-error-gladia-transcriber-failed"
|
44
|
+
PIPELINE_ERROR_SPEECHMATICS_TRANSCRIBER_FAILED = "pipeline-error-speechmatics-transcriber-failed"
|
42
45
|
PIPELINE_ERROR_ASSEMBLY_AI_TRANSCRIBER_FAILED = "pipeline-error-assembly-ai-transcriber-failed"
|
43
46
|
PIPELINE_ERROR_TALKSCRIBER_TRANSCRIBER_FAILED = "pipeline-error-talkscriber-transcriber-failed"
|
44
47
|
PIPELINE_ERROR_AZURE_SPEECH_TRANSCRIBER_FAILED = "pipeline-error-azure-speech-transcriber-failed"
|
@@ -66,6 +69,7 @@ module Vapi
|
|
66
69
|
PIPELINE_ERROR_GROQ_LLM_FAILED = "pipeline-error-groq-llm-failed"
|
67
70
|
PIPELINE_ERROR_GOOGLE_LLM_FAILED = "pipeline-error-google-llm-failed"
|
68
71
|
PIPELINE_ERROR_XAI_LLM_FAILED = "pipeline-error-xai-llm-failed"
|
72
|
+
PIPELINE_ERROR_MISTRAL_LLM_FAILED = "pipeline-error-mistral-llm-failed"
|
69
73
|
PIPELINE_ERROR_INFLECTION_AI_LLM_FAILED = "pipeline-error-inflection-ai-llm-failed"
|
70
74
|
PIPELINE_ERROR_CEREBRAS_LLM_FAILED = "pipeline-error-cerebras-llm-failed"
|
71
75
|
PIPELINE_ERROR_DEEP_SEEK_LLM_FAILED = "pipeline-error-deep-seek-llm-failed"
|
@@ -84,6 +88,11 @@ module Vapi
|
|
84
88
|
PIPELINE_ERROR_XAI_403_MODEL_ACCESS_DENIED = "pipeline-error-xai-403-model-access-denied"
|
85
89
|
PIPELINE_ERROR_XAI_429_EXCEEDED_QUOTA = "pipeline-error-xai-429-exceeded-quota"
|
86
90
|
PIPELINE_ERROR_XAI_500_SERVER_ERROR = "pipeline-error-xai-500-server-error"
|
91
|
+
PIPELINE_ERROR_MISTRAL_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-mistral-400-bad-request-validation-failed"
|
92
|
+
PIPELINE_ERROR_MISTRAL_401_UNAUTHORIZED = "pipeline-error-mistral-401-unauthorized"
|
93
|
+
PIPELINE_ERROR_MISTRAL_403_MODEL_ACCESS_DENIED = "pipeline-error-mistral-403-model-access-denied"
|
94
|
+
PIPELINE_ERROR_MISTRAL_429_EXCEEDED_QUOTA = "pipeline-error-mistral-429-exceeded-quota"
|
95
|
+
PIPELINE_ERROR_MISTRAL_500_SERVER_ERROR = "pipeline-error-mistral-500-server-error"
|
87
96
|
PIPELINE_ERROR_INFLECTION_AI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-inflection-ai-400-bad-request-validation-failed"
|
88
97
|
PIPELINE_ERROR_INFLECTION_AI_401_UNAUTHORIZED = "pipeline-error-inflection-ai-401-unauthorized"
|
89
98
|
PIPELINE_ERROR_INFLECTION_AI_403_MODEL_ACCESS_DENIED = "pipeline-error-inflection-ai-403-model-access-denied"
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "cartesia_experimental_controls_speed"
|
4
|
+
require_relative "cartesia_experimental_controls_emotion"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class CartesiaExperimentalControls
|
10
|
+
# @return [Vapi::CartesiaExperimentalControlsSpeed]
|
11
|
+
attr_reader :speed
|
12
|
+
# @return [Vapi::CartesiaExperimentalControlsEmotion]
|
13
|
+
attr_reader :emotion
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param speed [Vapi::CartesiaExperimentalControlsSpeed]
|
23
|
+
# @param emotion [Vapi::CartesiaExperimentalControlsEmotion]
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [Vapi::CartesiaExperimentalControls]
|
26
|
+
def initialize(speed: OMIT, emotion: OMIT, additional_properties: nil)
|
27
|
+
@speed = speed if speed != OMIT
|
28
|
+
@emotion = emotion if emotion != OMIT
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "speed": speed, "emotion": emotion }.reject do |_k, v|
|
31
|
+
v == OMIT
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Deserialize a JSON object to an instance of CartesiaExperimentalControls
|
36
|
+
#
|
37
|
+
# @param json_object [String]
|
38
|
+
# @return [Vapi::CartesiaExperimentalControls]
|
39
|
+
def self.from_json(json_object:)
|
40
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
41
|
+
parsed_json = JSON.parse(json_object)
|
42
|
+
speed = parsed_json["speed"]
|
43
|
+
emotion = parsed_json["emotion"]
|
44
|
+
new(
|
45
|
+
speed: speed,
|
46
|
+
emotion: emotion,
|
47
|
+
additional_properties: struct
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Serialize an instance of CartesiaExperimentalControls to a JSON object
|
52
|
+
#
|
53
|
+
# @return [String]
|
54
|
+
def to_json(*_args)
|
55
|
+
@_field_set&.to_json
|
56
|
+
end
|
57
|
+
|
58
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
59
|
+
# hash and check each fields type against the current object's property
|
60
|
+
# definitions.
|
61
|
+
#
|
62
|
+
# @param obj [Object]
|
63
|
+
# @return [Void]
|
64
|
+
def self.validate_raw(obj:)
|
65
|
+
obj.speed&.is_a?(Vapi::CartesiaExperimentalControlsSpeed) != false || raise("Passed value for field obj.speed is not the expected type, validation failed.")
|
66
|
+
obj.emotion&.is_a?(Vapi::CartesiaExperimentalControlsEmotion) != false || raise("Passed value for field obj.emotion is not the expected type, validation failed.")
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Vapi
|
4
|
+
class CartesiaExperimentalControlsEmotion
|
5
|
+
ANGER_LOWEST = "anger:lowest"
|
6
|
+
ANGER_LOW = "anger:low"
|
7
|
+
ANGER_HIGH = "anger:high"
|
8
|
+
ANGER_HIGHEST = "anger:highest"
|
9
|
+
POSITIVITY_LOWEST = "positivity:lowest"
|
10
|
+
POSITIVITY_LOW = "positivity:low"
|
11
|
+
POSITIVITY_HIGH = "positivity:high"
|
12
|
+
POSITIVITY_HIGHEST = "positivity:highest"
|
13
|
+
SURPRISE_LOWEST = "surprise:lowest"
|
14
|
+
SURPRISE_LOW = "surprise:low"
|
15
|
+
SURPRISE_HIGH = "surprise:high"
|
16
|
+
SURPRISE_HIGHEST = "surprise:highest"
|
17
|
+
SADNESS_LOWEST = "sadness:lowest"
|
18
|
+
SADNESS_LOW = "sadness:low"
|
19
|
+
SADNESS_HIGH = "sadness:high"
|
20
|
+
SADNESS_HIGHEST = "sadness:highest"
|
21
|
+
CURIOSITY_LOWEST = "curiosity:lowest"
|
22
|
+
CURIOSITY_LOW = "curiosity:low"
|
23
|
+
CURIOSITY_HIGH = "curiosity:high"
|
24
|
+
CURIOSITY_HIGHEST = "curiosity:highest"
|
25
|
+
end
|
26
|
+
end
|