vapi_server_sdk 0.2.0 → 0.3.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 +129 -62
- data/lib/vapi_server_sdk/assistants/client.rb +15 -2
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_credentials_item.rb +512 -0
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_model.rb +13 -0
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_transcriber.rb +13 -0
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb +13 -0
- data/lib/vapi_server_sdk/blocks/client.rb +7 -166
- data/lib/vapi_server_sdk/blocks/types/blocks_update_request.rb +109 -0
- data/lib/vapi_server_sdk/calls/client.rb +16 -4
- data/lib/vapi_server_sdk/knowledge_bases/client.rb +7 -8
- data/lib/vapi_server_sdk/knowledge_bases/types/knowledge_bases_update_request.rb +96 -0
- data/lib/vapi_server_sdk/logs/client.rb +84 -0
- data/lib/vapi_server_sdk/phone_numbers/client.rb +7 -69
- data/lib/vapi_server_sdk/phone_numbers/types/phone_numbers_update_request.rb +122 -0
- data/lib/vapi_server_sdk/squads/client.rb +8 -0
- data/lib/vapi_server_sdk/tools/client.rb +7 -91
- data/lib/vapi_server_sdk/tools/types/tools_update_request.rb +200 -0
- data/lib/vapi_server_sdk/types/assistant.rb +19 -1
- data/lib/vapi_server_sdk/types/assistant_credentials_item.rb +510 -0
- data/lib/vapi_server_sdk/types/assistant_model.rb +13 -0
- data/lib/vapi_server_sdk/types/assistant_overrides.rb +19 -1
- data/lib/vapi_server_sdk/types/assistant_overrides_credentials_item.rb +510 -0
- data/lib/vapi_server_sdk/types/assistant_overrides_model.rb +13 -0
- data/lib/vapi_server_sdk/types/assistant_overrides_transcriber.rb +13 -0
- data/lib/vapi_server_sdk/types/assistant_overrides_voice.rb +13 -0
- data/lib/vapi_server_sdk/types/assistant_transcriber.rb +13 -0
- data/lib/vapi_server_sdk/types/assistant_voice.rb +13 -0
- data/lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb +88 -0
- data/lib/vapi_server_sdk/types/azure_credential.rb +22 -5
- data/lib/vapi_server_sdk/types/azure_credential_region.rb +1 -1
- data/lib/vapi_server_sdk/types/azure_credential_service.rb +9 -0
- data/lib/vapi_server_sdk/types/azure_open_ai_credential.rb +9 -1
- data/lib/vapi_server_sdk/types/azure_open_ai_credential_region.rb +1 -1
- data/lib/vapi_server_sdk/types/azure_speech_transcriber.rb +62 -0
- data/lib/vapi_server_sdk/types/azure_speech_transcriber_language.rb +152 -0
- data/lib/vapi_server_sdk/types/buy_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/byo_phone_number.rb +25 -29
- data/lib/vapi_server_sdk/types/call_ended_reason.rb +44 -29
- data/lib/vapi_server_sdk/types/cartesia_voice_model.rb +2 -0
- data/lib/vapi_server_sdk/types/cerebras_credential.rb +111 -0
- data/lib/vapi_server_sdk/types/chat_dto.rb +103 -0
- data/lib/vapi_server_sdk/types/{credits_buy_dto.rb → chat_service_response.rb} +9 -17
- data/lib/vapi_server_sdk/types/cloudflare_credential.rb +142 -0
- data/lib/vapi_server_sdk/types/cloudflare_r_2_bucket_plan.rb +105 -0
- data/lib/vapi_server_sdk/types/create_anthropic_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_anyscale_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_assembly_ai_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_assistant_dto.rb +19 -1
- data/lib/vapi_server_sdk/types/create_assistant_dto_credentials_item.rb +510 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto_model.rb +13 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto_transcriber.rb +13 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto_voice.rb +13 -0
- data/lib/vapi_server_sdk/types/create_azure_credential_dto.rb +21 -12
- data/lib/vapi_server_sdk/types/create_azure_credential_dto_region.rb +1 -1
- data/lib/vapi_server_sdk/types/create_azure_credential_dto_service.rb +9 -0
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb +10 -9
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_region.rb +1 -1
- data/lib/vapi_server_sdk/types/create_byo_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb +1 -9
- data/lib/vapi_server_sdk/types/create_cartesia_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_cerebras_credential_dto.rb +74 -0
- data/lib/vapi_server_sdk/types/create_cloudflare_credential_dto.rb +101 -0
- data/lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb +2 -14
- data/lib/vapi_server_sdk/types/create_deep_infra_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_deep_seek_credential_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/create_deepgram_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_eleven_labs_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_gcp_credential_dto.rb +2 -14
- data/lib/vapi_server_sdk/types/create_gladia_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_go_high_level_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_groq_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_langfuse_credential_dto.rb +2 -15
- data/lib/vapi_server_sdk/types/create_lmnt_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_make_credential_dto.rb +2 -15
- data/lib/vapi_server_sdk/types/create_open_ai_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_open_router_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_org_dto.rb +25 -25
- data/lib/vapi_server_sdk/types/create_perplexity_ai_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_play_ht_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_rime_ai_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_runpod_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_s_3_credential_dto.rb +2 -10
- data/lib/vapi_server_sdk/types/create_smallest_ai_credential_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/create_tavus_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_together_ai_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_twilio_credential_dto.rb +2 -14
- data/lib/vapi_server_sdk/types/create_twilio_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/create_vapi_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/create_vonage_credential_dto.rb +2 -14
- data/lib/vapi_server_sdk/types/create_vonage_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/create_webhook_credential_dto.rb +2 -13
- data/lib/vapi_server_sdk/types/create_x_ai_credential_dto.rb +2 -11
- data/lib/vapi_server_sdk/types/deep_seek_credential.rb +111 -0
- data/lib/vapi_server_sdk/types/deep_seek_model.rb +177 -0
- data/lib/vapi_server_sdk/types/deep_seek_model_tools_item.rb +159 -0
- data/lib/vapi_server_sdk/types/eleven_labs_voice_model.rb +2 -0
- data/lib/vapi_server_sdk/types/fallback_cartesia_voice_model.rb +2 -0
- data/lib/vapi_server_sdk/types/fallback_eleven_labs_voice_model.rb +2 -0
- data/lib/vapi_server_sdk/types/fallback_open_ai_voice.rb +4 -4
- data/lib/vapi_server_sdk/types/fallback_open_ai_voice_id.rb +2 -2
- data/lib/vapi_server_sdk/types/fallback_plan_voices_item.rb +13 -0
- data/lib/vapi_server_sdk/types/fallback_smallest_ai_voice.rb +95 -0
- data/lib/vapi_server_sdk/types/fallback_smallest_ai_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/fallback_smallest_ai_voice_id_enum.rb +31 -0
- data/lib/vapi_server_sdk/types/gemini_multimodal_live_prebuilt_voice_config.rb +58 -0
- data/lib/vapi_server_sdk/types/gemini_multimodal_live_prebuilt_voice_config_voice_name.rb +11 -0
- data/lib/vapi_server_sdk/types/gemini_multimodal_live_speech_config.rb +61 -0
- data/lib/vapi_server_sdk/types/gemini_multimodal_live_voice_config.rb +61 -0
- data/lib/vapi_server_sdk/types/google_model.rb +17 -1
- data/lib/vapi_server_sdk/types/google_model_model.rb +2 -0
- data/lib/vapi_server_sdk/types/google_realtime_config.rb +121 -0
- data/lib/vapi_server_sdk/types/groq_model_model.rb +1 -3
- data/lib/vapi_server_sdk/types/import_twilio_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/import_vonage_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/open_ai_model_fallback_models_item.rb +6 -0
- data/lib/vapi_server_sdk/types/open_ai_model_model.rb +6 -0
- data/lib/vapi_server_sdk/types/open_ai_voice.rb +4 -4
- data/lib/vapi_server_sdk/types/open_ai_voice_id.rb +2 -2
- data/lib/vapi_server_sdk/types/org.rb +25 -25
- data/lib/vapi_server_sdk/types/org_with_org_user.rb +25 -25
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report_ended_reason.rb +44 -29
- data/lib/vapi_server_sdk/types/server_message_status_update.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_status_update_ended_reason.rb +44 -29
- data/lib/vapi_server_sdk/types/smallest_ai_credential.rb +111 -0
- data/lib/vapi_server_sdk/types/smallest_ai_voice.rb +117 -0
- data/lib/vapi_server_sdk/types/smallest_ai_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/smallest_ai_voice_id_enum.rb +31 -0
- data/lib/vapi_server_sdk/types/subscription.rb +2 -2
- data/lib/vapi_server_sdk/types/sync_voice_library_dto_providers_item.rb +1 -0
- data/lib/vapi_server_sdk/types/transfer_plan.rb +26 -6
- data/lib/vapi_server_sdk/types/transfer_plan_message.rb +2 -1
- data/lib/vapi_server_sdk/types/twilio_phone_number.rb +25 -29
- data/lib/vapi_server_sdk/types/update_anthropic_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_anyscale_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_assembly_ai_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_azure_credential_dto.rb +24 -14
- data/lib/vapi_server_sdk/types/update_azure_credential_dto_region.rb +1 -1
- data/lib/vapi_server_sdk/types/update_azure_credential_dto_service.rb +9 -0
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto.rb +25 -24
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_region.rb +1 -1
- data/lib/vapi_server_sdk/types/update_bash_tool_dto.rb +161 -0
- data/lib/vapi_server_sdk/types/update_bash_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_byo_phone_number_dto.rb +187 -0
- data/lib/vapi_server_sdk/types/update_byo_phone_number_dto_fallback_destination.rb +101 -0
- data/lib/vapi_server_sdk/types/update_byo_sip_trunk_credential_dto.rb +13 -21
- data/lib/vapi_server_sdk/types/update_cartesia_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_cerebras_credential_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb +101 -0
- data/lib/vapi_server_sdk/types/update_computer_tool_dto.rb +185 -0
- data/lib/vapi_server_sdk/types/update_computer_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_conversation_block_dto.rb +206 -0
- data/lib/vapi_server_sdk/types/update_conversation_block_dto_messages_item.rb +95 -0
- data/lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb +139 -0
- data/lib/vapi_server_sdk/types/update_custom_llm_credential_dto.rb +4 -16
- data/lib/vapi_server_sdk/types/update_deep_infra_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_deep_seek_credential_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/update_deepgram_credential_dto.rb +11 -18
- data/lib/vapi_server_sdk/types/update_dtmf_tool_dto.rb +139 -0
- data/lib/vapi_server_sdk/types/update_dtmf_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_eleven_labs_credential_dto.rb +11 -11
- data/lib/vapi_server_sdk/types/update_end_call_tool_dto.rb +139 -0
- data/lib/vapi_server_sdk/types/update_end_call_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_function_tool_dto.rb +139 -0
- data/lib/vapi_server_sdk/types/update_function_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_gcp_credential_dto.rb +11 -23
- data/lib/vapi_server_sdk/types/update_ghl_tool_dto.rb +159 -0
- data/lib/vapi_server_sdk/types/update_ghl_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_gladia_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_go_high_level_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_google_credential_dto.rb +4 -13
- data/lib/vapi_server_sdk/types/update_groq_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_inflection_ai_credential_dto.rb +4 -13
- data/lib/vapi_server_sdk/types/update_langfuse_credential_dto.rb +8 -21
- data/lib/vapi_server_sdk/types/update_lmnt_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_make_credential_dto.rb +8 -21
- data/lib/vapi_server_sdk/types/update_make_tool_dto.rb +159 -0
- data/lib/vapi_server_sdk/types/update_make_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_open_ai_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_open_router_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_org_dto.rb +25 -25
- data/lib/vapi_server_sdk/types/update_output_tool_dto.rb +139 -0
- data/lib/vapi_server_sdk/types/update_output_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_perplexity_ai_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_play_ht_credential_dto.rb +11 -18
- data/lib/vapi_server_sdk/types/update_rime_ai_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_runpod_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_s_3_credential_dto.rb +12 -20
- data/lib/vapi_server_sdk/types/update_smallest_ai_credential_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/update_tavus_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_text_editor_tool_dto.rb +161 -0
- data/lib/vapi_server_sdk/types/update_text_editor_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_together_ai_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_token_dto.rb +81 -0
- data/lib/vapi_server_sdk/types/update_token_dto_tag.rb +9 -0
- data/lib/vapi_server_sdk/types/update_tool_call_block_dto.rb +168 -0
- data/lib/vapi_server_sdk/types/update_tool_call_block_dto_messages_item.rb +94 -0
- data/lib/vapi_server_sdk/types/update_tool_call_block_dto_tool.rb +161 -0
- data/lib/vapi_server_sdk/types/update_transfer_call_tool_dto.rb +161 -0
- data/lib/vapi_server_sdk/types/update_transfer_call_tool_dto_destinations_item.rb +121 -0
- data/lib/vapi_server_sdk/types/update_transfer_call_tool_dto_messages_item.rb +121 -0
- data/lib/vapi_server_sdk/types/update_trieve_knowledge_base_dto.rb +109 -0
- data/lib/vapi_server_sdk/types/update_twilio_credential_dto.rb +11 -23
- data/lib/vapi_server_sdk/types/update_twilio_phone_number_dto.rb +163 -0
- data/lib/vapi_server_sdk/types/update_twilio_phone_number_dto_fallback_destination.rb +101 -0
- data/lib/vapi_server_sdk/types/update_vapi_phone_number_dto.rb +169 -0
- data/lib/vapi_server_sdk/types/update_vapi_phone_number_dto_fallback_destination.rb +101 -0
- data/lib/vapi_server_sdk/types/update_vonage_credential_dto.rb +11 -23
- data/lib/vapi_server_sdk/types/update_vonage_phone_number_dto.rb +157 -0
- data/lib/vapi_server_sdk/types/update_vonage_phone_number_dto_fallback_destination.rb +101 -0
- data/lib/vapi_server_sdk/types/update_workflow_block_dto.rb +154 -0
- data/lib/vapi_server_sdk/types/update_workflow_block_dto_messages_item.rb +94 -0
- data/lib/vapi_server_sdk/types/update_workflow_block_dto_steps_item.rb +94 -0
- data/lib/vapi_server_sdk/types/update_x_ai_credential_dto.rb +4 -13
- data/lib/vapi_server_sdk/types/vapi_phone_number.rb +25 -29
- data/lib/vapi_server_sdk/types/vonage_phone_number.rb +25 -29
- metadata +88 -21
- data/lib/vapi_server_sdk/blocks/types/update_block_dto_messages_item.rb +0 -96
- data/lib/vapi_server_sdk/blocks/types/update_block_dto_steps_item.rb +0 -96
- data/lib/vapi_server_sdk/blocks/types/update_block_dto_tool.rb +0 -163
- data/lib/vapi_server_sdk/phone_numbers/types/update_phone_number_dto_fallback_destination.rb +0 -103
- data/lib/vapi_server_sdk/tools/types/update_tool_dto_messages_item.rb +0 -122
- data/lib/vapi_server_sdk/types/auto_reload_plan_dto.rb +0 -65
- data/lib/vapi_server_sdk/types/hipaa_buy_dto.rb +0 -65
- data/lib/vapi_server_sdk/types/payment.rb +0 -167
- data/lib/vapi_server_sdk/types/payment_retry_dto.rb +0 -55
- data/lib/vapi_server_sdk/types/payment_status.rb +0 -11
- data/lib/vapi_server_sdk/types/payments_paginated_response.rb +0 -75
- data/lib/vapi_server_sdk/types/subscription_concurrency_line_buy_dto.rb +0 -55
- data/lib/vapi_server_sdk/types/subscription_concurrency_line_remove_dto.rb +0 -55
- data/lib/vapi_server_sdk/types/subscription_coupon_add_dto.rb +0 -67
- data/lib/vapi_server_sdk/types/subscription_monthly_charge.rb +0 -65
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "buy_phone_number_dto_fallback_destination"
|
4
|
+
require_relative "server"
|
4
5
|
require "ostruct"
|
5
6
|
require "json"
|
6
7
|
|
@@ -27,16 +28,13 @@ module Vapi
|
|
27
28
|
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
28
29
|
# shape of the message and response that is expected.
|
29
30
|
attr_reader :squad_id
|
30
|
-
# @return [
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
|
36
|
-
|
37
|
-
# as a header called x-vapi-secret.
|
38
|
-
# Same precedence logic as serverUrl.
|
39
|
-
attr_reader :server_url_secret
|
31
|
+
# @return [Vapi::Server] This is where Vapi will send webhooks. You can find all webhooks available along
|
32
|
+
# with their shape in ServerMessage schema.
|
33
|
+
# The order of precedence is:
|
34
|
+
# 1. assistant.server
|
35
|
+
# 2. phoneNumber.server
|
36
|
+
# 3. org.server
|
37
|
+
attr_reader :server
|
40
38
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
41
39
|
attr_reader :additional_properties
|
42
40
|
# @return [Object]
|
@@ -61,25 +59,22 @@ module Vapi
|
|
61
59
|
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
62
60
|
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
63
61
|
# shape of the message and response that is expected.
|
64
|
-
# @param
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
# as a header called x-vapi-secret.
|
71
|
-
# Same precedence logic as serverUrl.
|
62
|
+
# @param server [Vapi::Server] This is where Vapi will send webhooks. You can find all webhooks available along
|
63
|
+
# with their shape in ServerMessage schema.
|
64
|
+
# The order of precedence is:
|
65
|
+
# 1. assistant.server
|
66
|
+
# 2. phoneNumber.server
|
67
|
+
# 3. org.server
|
72
68
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
73
69
|
# @return [Vapi::BuyPhoneNumberDto]
|
74
70
|
def initialize(area_code:, fallback_destination: OMIT, name: OMIT, assistant_id: OMIT, squad_id: OMIT,
|
75
|
-
|
71
|
+
server: OMIT, additional_properties: nil)
|
76
72
|
@fallback_destination = fallback_destination if fallback_destination != OMIT
|
77
73
|
@area_code = area_code
|
78
74
|
@name = name if name != OMIT
|
79
75
|
@assistant_id = assistant_id if assistant_id != OMIT
|
80
76
|
@squad_id = squad_id if squad_id != OMIT
|
81
|
-
@
|
82
|
-
@server_url_secret = server_url_secret if server_url_secret != OMIT
|
77
|
+
@server = server if server != OMIT
|
83
78
|
@additional_properties = additional_properties
|
84
79
|
@_field_set = {
|
85
80
|
"fallbackDestination": fallback_destination,
|
@@ -87,8 +82,7 @@ module Vapi
|
|
87
82
|
"name": name,
|
88
83
|
"assistantId": assistant_id,
|
89
84
|
"squadId": squad_id,
|
90
|
-
"
|
91
|
-
"serverUrlSecret": server_url_secret
|
85
|
+
"server": server
|
92
86
|
}.reject do |_k, v|
|
93
87
|
v == OMIT
|
94
88
|
end
|
@@ -111,16 +105,19 @@ module Vapi
|
|
111
105
|
name = parsed_json["name"]
|
112
106
|
assistant_id = parsed_json["assistantId"]
|
113
107
|
squad_id = parsed_json["squadId"]
|
114
|
-
|
115
|
-
|
108
|
+
if parsed_json["server"].nil?
|
109
|
+
server = nil
|
110
|
+
else
|
111
|
+
server = parsed_json["server"].to_json
|
112
|
+
server = Vapi::Server.from_json(json_object: server)
|
113
|
+
end
|
116
114
|
new(
|
117
115
|
fallback_destination: fallback_destination,
|
118
116
|
area_code: area_code,
|
119
117
|
name: name,
|
120
118
|
assistant_id: assistant_id,
|
121
119
|
squad_id: squad_id,
|
122
|
-
|
123
|
-
server_url_secret: server_url_secret,
|
120
|
+
server: server,
|
124
121
|
additional_properties: struct
|
125
122
|
)
|
126
123
|
end
|
@@ -144,8 +141,7 @@ module Vapi
|
|
144
141
|
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
145
142
|
obj.assistant_id&.is_a?(String) != false || raise("Passed value for field obj.assistant_id is not the expected type, validation failed.")
|
146
143
|
obj.squad_id&.is_a?(String) != false || raise("Passed value for field obj.squad_id is not the expected type, validation failed.")
|
147
|
-
obj.
|
148
|
-
obj.server_url_secret&.is_a?(String) != false || raise("Passed value for field obj.server_url_secret is not the expected type, validation failed.")
|
144
|
+
obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server)
|
149
145
|
end
|
150
146
|
end
|
151
147
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "byo_phone_number_fallback_destination"
|
4
4
|
require "date"
|
5
|
+
require_relative "server"
|
5
6
|
require "ostruct"
|
6
7
|
require "json"
|
7
8
|
|
@@ -45,16 +46,13 @@ module Vapi
|
|
45
46
|
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
46
47
|
# shape of the message and response that is expected.
|
47
48
|
attr_reader :squad_id
|
48
|
-
# @return [
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
|
54
|
-
|
55
|
-
# as a header called x-vapi-secret.
|
56
|
-
# Same precedence logic as serverUrl.
|
57
|
-
attr_reader :server_url_secret
|
49
|
+
# @return [Vapi::Server] This is where Vapi will send webhooks. You can find all webhooks available along
|
50
|
+
# with their shape in ServerMessage schema.
|
51
|
+
# The order of precedence is:
|
52
|
+
# 1. assistant.server
|
53
|
+
# 2. phoneNumber.server
|
54
|
+
# 3. org.server
|
55
|
+
attr_reader :server
|
58
56
|
# @return [String] This is the number of the customer.
|
59
57
|
attr_reader :number
|
60
58
|
# @return [String] This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`)
|
@@ -99,14 +97,12 @@ module Vapi
|
|
99
97
|
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
100
98
|
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
101
99
|
# shape of the message and response that is expected.
|
102
|
-
# @param
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
# as a header called x-vapi-secret.
|
109
|
-
# Same precedence logic as serverUrl.
|
100
|
+
# @param server [Vapi::Server] This is where Vapi will send webhooks. You can find all webhooks available along
|
101
|
+
# with their shape in ServerMessage schema.
|
102
|
+
# The order of precedence is:
|
103
|
+
# 1. assistant.server
|
104
|
+
# 2. phoneNumber.server
|
105
|
+
# 3. org.server
|
110
106
|
# @param number [String] This is the number of the customer.
|
111
107
|
# @param credential_id [String] This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`)
|
112
108
|
# which can be used to make calls to this phone number.
|
@@ -115,7 +111,7 @@ module Vapi
|
|
115
111
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
116
112
|
# @return [Vapi::ByoPhoneNumber]
|
117
113
|
def initialize(id:, org_id:, created_at:, updated_at:, credential_id:, fallback_destination: OMIT,
|
118
|
-
number_e_164_check_enabled: OMIT, name: OMIT, assistant_id: OMIT, squad_id: OMIT,
|
114
|
+
number_e_164_check_enabled: OMIT, name: OMIT, assistant_id: OMIT, squad_id: OMIT, server: OMIT, number: OMIT, additional_properties: nil)
|
119
115
|
@fallback_destination = fallback_destination if fallback_destination != OMIT
|
120
116
|
@number_e_164_check_enabled = number_e_164_check_enabled if number_e_164_check_enabled != OMIT
|
121
117
|
@id = id
|
@@ -125,8 +121,7 @@ module Vapi
|
|
125
121
|
@name = name if name != OMIT
|
126
122
|
@assistant_id = assistant_id if assistant_id != OMIT
|
127
123
|
@squad_id = squad_id if squad_id != OMIT
|
128
|
-
@
|
129
|
-
@server_url_secret = server_url_secret if server_url_secret != OMIT
|
124
|
+
@server = server if server != OMIT
|
130
125
|
@number = number if number != OMIT
|
131
126
|
@credential_id = credential_id
|
132
127
|
@additional_properties = additional_properties
|
@@ -140,8 +135,7 @@ module Vapi
|
|
140
135
|
"name": name,
|
141
136
|
"assistantId": assistant_id,
|
142
137
|
"squadId": squad_id,
|
143
|
-
"
|
144
|
-
"serverUrlSecret": server_url_secret,
|
138
|
+
"server": server,
|
145
139
|
"number": number,
|
146
140
|
"credentialId": credential_id
|
147
141
|
}.reject do |_k, v|
|
@@ -170,8 +164,12 @@ module Vapi
|
|
170
164
|
name = parsed_json["name"]
|
171
165
|
assistant_id = parsed_json["assistantId"]
|
172
166
|
squad_id = parsed_json["squadId"]
|
173
|
-
|
174
|
-
|
167
|
+
if parsed_json["server"].nil?
|
168
|
+
server = nil
|
169
|
+
else
|
170
|
+
server = parsed_json["server"].to_json
|
171
|
+
server = Vapi::Server.from_json(json_object: server)
|
172
|
+
end
|
175
173
|
number = parsed_json["number"]
|
176
174
|
credential_id = parsed_json["credentialId"]
|
177
175
|
new(
|
@@ -184,8 +182,7 @@ module Vapi
|
|
184
182
|
name: name,
|
185
183
|
assistant_id: assistant_id,
|
186
184
|
squad_id: squad_id,
|
187
|
-
|
188
|
-
server_url_secret: server_url_secret,
|
185
|
+
server: server,
|
189
186
|
number: number,
|
190
187
|
credential_id: credential_id,
|
191
188
|
additional_properties: struct
|
@@ -215,8 +212,7 @@ module Vapi
|
|
215
212
|
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
216
213
|
obj.assistant_id&.is_a?(String) != false || raise("Passed value for field obj.assistant_id is not the expected type, validation failed.")
|
217
214
|
obj.squad_id&.is_a?(String) != false || raise("Passed value for field obj.squad_id is not the expected type, validation failed.")
|
218
|
-
obj.
|
219
|
-
obj.server_url_secret&.is_a?(String) != false || raise("Passed value for field obj.server_url_secret is not the expected type, validation failed.")
|
215
|
+
obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server)
|
220
216
|
obj.number&.is_a?(String) != false || raise("Passed value for field obj.number is not the expected type, validation failed.")
|
221
217
|
obj.credential_id.is_a?(String) != false || raise("Passed value for field obj.credential_id is not the expected type, validation failed.")
|
222
218
|
end
|
@@ -3,6 +3,30 @@
|
|
3
3
|
module Vapi
|
4
4
|
# This is the explanation for how the call ended.
|
5
5
|
class CallEndedReason
|
6
|
+
ASSISTANT_NOT_INVALID = "assistant-not-invalid"
|
7
|
+
ASSISTANT_NOT_PROVIDED = "assistant-not-provided"
|
8
|
+
CALL_START_ERROR_NEITHER_ASSISTANT_NOR_SERVER_SET = "call-start-error-neither-assistant-nor-server-set"
|
9
|
+
ASSISTANT_REQUEST_FAILED = "assistant-request-failed"
|
10
|
+
ASSISTANT_REQUEST_RETURNED_ERROR = "assistant-request-returned-error"
|
11
|
+
ASSISTANT_REQUEST_RETURNED_UNSPEAKABLE_ERROR = "assistant-request-returned-unspeakable-error"
|
12
|
+
ASSISTANT_REQUEST_RETURNED_INVALID_ASSISTANT = "assistant-request-returned-invalid-assistant"
|
13
|
+
ASSISTANT_REQUEST_RETURNED_NO_ASSISTANT = "assistant-request-returned-no-assistant"
|
14
|
+
ASSISTANT_REQUEST_RETURNED_FORWARDING_PHONE_NUMBER = "assistant-request-returned-forwarding-phone-number"
|
15
|
+
ASSISTANT_ENDED_CALL = "assistant-ended-call"
|
16
|
+
ASSISTANT_SAID_END_CALL_PHRASE = "assistant-said-end-call-phrase"
|
17
|
+
ASSISTANT_FORWARDED_CALL = "assistant-forwarded-call"
|
18
|
+
ASSISTANT_JOIN_TIMED_OUT = "assistant-join-timed-out"
|
19
|
+
CUSTOMER_BUSY = "customer-busy"
|
20
|
+
CUSTOMER_ENDED_CALL = "customer-ended-call"
|
21
|
+
CUSTOMER_DID_NOT_ANSWER = "customer-did-not-answer"
|
22
|
+
CUSTOMER_DID_NOT_GIVE_MICROPHONE_PERMISSION = "customer-did-not-give-microphone-permission"
|
23
|
+
ASSISTANT_SAID_MESSAGE_WITH_END_CALL_ENABLED = "assistant-said-message-with-end-call-enabled"
|
24
|
+
EXCEEDED_MAX_DURATION = "exceeded-max-duration"
|
25
|
+
MANUALLY_CANCELED = "manually-canceled"
|
26
|
+
PHONE_CALL_PROVIDER_CLOSED_WEBSOCKET = "phone-call-provider-closed-websocket"
|
27
|
+
DB_ERROR = "db-error"
|
28
|
+
ASSISTANT_NOT_FOUND = "assistant-not-found"
|
29
|
+
LICENSE_CHECK_FAILED = "license-check-failed"
|
6
30
|
PIPELINE_ERROR_OPENAI_VOICE_FAILED = "pipeline-error-openai-voice-failed"
|
7
31
|
PIPELINE_ERROR_CARTESIA_VOICE_FAILED = "pipeline-error-cartesia-voice-failed"
|
8
32
|
PIPELINE_ERROR_DEEPGRAM_VOICE_FAILED = "pipeline-error-deepgram-voice-failed"
|
@@ -12,9 +36,12 @@ module Vapi
|
|
12
36
|
PIPELINE_ERROR_AZURE_VOICE_FAILED = "pipeline-error-azure-voice-failed"
|
13
37
|
PIPELINE_ERROR_RIME_AI_VOICE_FAILED = "pipeline-error-rime-ai-voice-failed"
|
14
38
|
PIPELINE_ERROR_NEETS_VOICE_FAILED = "pipeline-error-neets-voice-failed"
|
15
|
-
|
16
|
-
|
17
|
-
|
39
|
+
PIPELINE_ERROR_SMALLEST_AI_VOICE_FAILED = "pipeline-error-smallest-ai-voice-failed"
|
40
|
+
PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED = "pipeline-error-deepgram-transcriber-failed"
|
41
|
+
PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED = "pipeline-error-gladia-transcriber-failed"
|
42
|
+
PIPELINE_ERROR_ASSEMBLY_AI_TRANSCRIBER_FAILED = "pipeline-error-assembly-ai-transcriber-failed"
|
43
|
+
PIPELINE_ERROR_TALKSCRIBER_TRANSCRIBER_FAILED = "pipeline-error-talkscriber-transcriber-failed"
|
44
|
+
PIPELINE_ERROR_AZURE_SPEECH_TRANSCRIBER_FAILED = "pipeline-error-azure-speech-transcriber-failed"
|
18
45
|
PIPELINE_ERROR_VAPI_LLM_FAILED = "pipeline-error-vapi-llm-failed"
|
19
46
|
PIPELINE_ERROR_VAPI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-vapi-400-bad-request-validation-failed"
|
20
47
|
PIPELINE_ERROR_VAPI_401_UNAUTHORIZED = "pipeline-error-vapi-401-unauthorized"
|
@@ -34,36 +61,14 @@ module Vapi
|
|
34
61
|
VAPIFAULT_WEB_CALL_WORKER_SETUP_FAILED = "vapifault-web-call-worker-setup-failed"
|
35
62
|
VAPIFAULT_TRANSPORT_CONNECTED_BUT_CALL_NOT_ACTIVE = "vapifault-transport-connected-but-call-not-active"
|
36
63
|
VAPIFAULT_CALL_STARTED_BUT_CONNECTION_TO_TRANSPORT_MISSING = "vapifault-call-started-but-connection-to-transport-missing"
|
37
|
-
PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED = "pipeline-error-deepgram-transcriber-failed"
|
38
|
-
PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED = "pipeline-error-gladia-transcriber-failed"
|
39
|
-
PIPELINE_ERROR_ASSEMBLY_AI_TRANSCRIBER_FAILED = "pipeline-error-assembly-ai-transcriber-failed"
|
40
64
|
PIPELINE_ERROR_OPENAI_LLM_FAILED = "pipeline-error-openai-llm-failed"
|
41
65
|
PIPELINE_ERROR_AZURE_OPENAI_LLM_FAILED = "pipeline-error-azure-openai-llm-failed"
|
42
66
|
PIPELINE_ERROR_GROQ_LLM_FAILED = "pipeline-error-groq-llm-failed"
|
43
67
|
PIPELINE_ERROR_GOOGLE_LLM_FAILED = "pipeline-error-google-llm-failed"
|
44
68
|
PIPELINE_ERROR_XAI_LLM_FAILED = "pipeline-error-xai-llm-failed"
|
45
69
|
PIPELINE_ERROR_INFLECTION_AI_LLM_FAILED = "pipeline-error-inflection-ai-llm-failed"
|
46
|
-
|
47
|
-
|
48
|
-
CALL_START_ERROR_NEITHER_ASSISTANT_NOR_SERVER_SET = "call-start-error-neither-assistant-nor-server-set"
|
49
|
-
ASSISTANT_REQUEST_FAILED = "assistant-request-failed"
|
50
|
-
ASSISTANT_REQUEST_RETURNED_ERROR = "assistant-request-returned-error"
|
51
|
-
ASSISTANT_REQUEST_RETURNED_UNSPEAKABLE_ERROR = "assistant-request-returned-unspeakable-error"
|
52
|
-
ASSISTANT_REQUEST_RETURNED_INVALID_ASSISTANT = "assistant-request-returned-invalid-assistant"
|
53
|
-
ASSISTANT_REQUEST_RETURNED_NO_ASSISTANT = "assistant-request-returned-no-assistant"
|
54
|
-
ASSISTANT_REQUEST_RETURNED_FORWARDING_PHONE_NUMBER = "assistant-request-returned-forwarding-phone-number"
|
55
|
-
ASSISTANT_ENDED_CALL = "assistant-ended-call"
|
56
|
-
ASSISTANT_SAID_END_CALL_PHRASE = "assistant-said-end-call-phrase"
|
57
|
-
ASSISTANT_FORWARDED_CALL = "assistant-forwarded-call"
|
58
|
-
ASSISTANT_JOIN_TIMED_OUT = "assistant-join-timed-out"
|
59
|
-
CUSTOMER_BUSY = "customer-busy"
|
60
|
-
CUSTOMER_ENDED_CALL = "customer-ended-call"
|
61
|
-
CUSTOMER_DID_NOT_ANSWER = "customer-did-not-answer"
|
62
|
-
CUSTOMER_DID_NOT_GIVE_MICROPHONE_PERMISSION = "customer-did-not-give-microphone-permission"
|
63
|
-
ASSISTANT_SAID_MESSAGE_WITH_END_CALL_ENABLED = "assistant-said-message-with-end-call-enabled"
|
64
|
-
EXCEEDED_MAX_DURATION = "exceeded-max-duration"
|
65
|
-
MANUALLY_CANCELED = "manually-canceled"
|
66
|
-
PHONE_CALL_PROVIDER_CLOSED_WEBSOCKET = "phone-call-provider-closed-websocket"
|
70
|
+
PIPELINE_ERROR_CEREBRAS_LLM_FAILED = "pipeline-error-cerebras-llm-failed"
|
71
|
+
PIPELINE_ERROR_DEEP_SEEK_LLM_FAILED = "pipeline-error-deep-seek-llm-failed"
|
67
72
|
PIPELINE_ERROR_OPENAI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-openai-400-bad-request-validation-failed"
|
68
73
|
PIPELINE_ERROR_OPENAI_401_UNAUTHORIZED = "pipeline-error-openai-401-unauthorized"
|
69
74
|
PIPELINE_ERROR_OPENAI_403_MODEL_ACCESS_DENIED = "pipeline-error-openai-403-model-access-denied"
|
@@ -84,6 +89,11 @@ module Vapi
|
|
84
89
|
PIPELINE_ERROR_INFLECTION_AI_403_MODEL_ACCESS_DENIED = "pipeline-error-inflection-ai-403-model-access-denied"
|
85
90
|
PIPELINE_ERROR_INFLECTION_AI_429_EXCEEDED_QUOTA = "pipeline-error-inflection-ai-429-exceeded-quota"
|
86
91
|
PIPELINE_ERROR_INFLECTION_AI_500_SERVER_ERROR = "pipeline-error-inflection-ai-500-server-error"
|
92
|
+
PIPELINE_ERROR_DEEP_SEEK_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-deep-seek-400-bad-request-validation-failed"
|
93
|
+
PIPELINE_ERROR_DEEP_SEEK_401_UNAUTHORIZED = "pipeline-error-deep-seek-401-unauthorized"
|
94
|
+
PIPELINE_ERROR_DEEP_SEEK_403_MODEL_ACCESS_DENIED = "pipeline-error-deep-seek-403-model-access-denied"
|
95
|
+
PIPELINE_ERROR_DEEP_SEEK_429_EXCEEDED_QUOTA = "pipeline-error-deep-seek-429-exceeded-quota"
|
96
|
+
PIPELINE_ERROR_DEEP_SEEK_500_SERVER_ERROR = "pipeline-error-deep-seek-500-server-error"
|
87
97
|
PIPELINE_ERROR_AZURE_OPENAI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-azure-openai-400-bad-request-validation-failed"
|
88
98
|
PIPELINE_ERROR_AZURE_OPENAI_401_UNAUTHORIZED = "pipeline-error-azure-openai-401-unauthorized"
|
89
99
|
PIPELINE_ERROR_AZURE_OPENAI_403_MODEL_ACCESS_DENIED = "pipeline-error-azure-openai-403-model-access-denied"
|
@@ -94,6 +104,11 @@ module Vapi
|
|
94
104
|
PIPELINE_ERROR_GROQ_403_MODEL_ACCESS_DENIED = "pipeline-error-groq-403-model-access-denied"
|
95
105
|
PIPELINE_ERROR_GROQ_429_EXCEEDED_QUOTA = "pipeline-error-groq-429-exceeded-quota"
|
96
106
|
PIPELINE_ERROR_GROQ_500_SERVER_ERROR = "pipeline-error-groq-500-server-error"
|
107
|
+
PIPELINE_ERROR_CEREBRAS_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-cerebras-400-bad-request-validation-failed"
|
108
|
+
PIPELINE_ERROR_CEREBRAS_401_UNAUTHORIZED = "pipeline-error-cerebras-401-unauthorized"
|
109
|
+
PIPELINE_ERROR_CEREBRAS_403_MODEL_ACCESS_DENIED = "pipeline-error-cerebras-403-model-access-denied"
|
110
|
+
PIPELINE_ERROR_CEREBRAS_429_EXCEEDED_QUOTA = "pipeline-error-cerebras-429-exceeded-quota"
|
111
|
+
PIPELINE_ERROR_CEREBRAS_500_SERVER_ERROR = "pipeline-error-cerebras-500-server-error"
|
97
112
|
PIPELINE_ERROR_ANTHROPIC_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-anthropic-400-bad-request-validation-failed"
|
98
113
|
PIPELINE_ERROR_ANTHROPIC_401_UNAUTHORIZED = "pipeline-error-anthropic-401-unauthorized"
|
99
114
|
PIPELINE_ERROR_ANTHROPIC_403_MODEL_ACCESS_DENIED = "pipeline-error-anthropic-403-model-access-denied"
|
@@ -181,6 +196,8 @@ module Vapi
|
|
181
196
|
PIPELINE_ERROR_PLAYHT_429_EXCEEDED_QUOTA = "pipeline-error-playht-429-exceeded-quota"
|
182
197
|
PIPELINE_ERROR_PLAYHT_502_GATEWAY_ERROR = "pipeline-error-playht-502-gateway-error"
|
183
198
|
PIPELINE_ERROR_PLAYHT_504_GATEWAY_ERROR = "pipeline-error-playht-504-gateway-error"
|
199
|
+
PIPELINE_ERROR_TAVUS_VIDEO_FAILED = "pipeline-error-tavus-video-failed"
|
200
|
+
PIPELINE_ERROR_CUSTOM_TRANSCRIBER_FAILED = "pipeline-error-custom-transcriber-failed"
|
184
201
|
PIPELINE_ERROR_DEEPGRAM_RETURNING_403_MODEL_ACCESS_DENIED = "pipeline-error-deepgram-returning-403-model-access-denied"
|
185
202
|
PIPELINE_ERROR_DEEPGRAM_RETURNING_401_INVALID_CREDENTIALS = "pipeline-error-deepgram-returning-401-invalid-credentials"
|
186
203
|
PIPELINE_ERROR_DEEPGRAM_RETURNING_404_NOT_FOUND = "pipeline-error-deepgram-returning-404-not-found"
|
@@ -188,8 +205,6 @@ module Vapi
|
|
188
205
|
PIPELINE_ERROR_DEEPGRAM_RETURNING_500_INVALID_JSON = "pipeline-error-deepgram-returning-500-invalid-json"
|
189
206
|
PIPELINE_ERROR_DEEPGRAM_RETURNING_502_NETWORK_ERROR = "pipeline-error-deepgram-returning-502-network-error"
|
190
207
|
PIPELINE_ERROR_DEEPGRAM_RETURNING_502_BAD_GATEWAY_EHOSTUNREACH = "pipeline-error-deepgram-returning-502-bad-gateway-ehostunreach"
|
191
|
-
PIPELINE_ERROR_TAVUS_VIDEO_FAILED = "pipeline-error-tavus-video-failed"
|
192
|
-
PIPELINE_ERROR_CUSTOM_TRANSCRIBER_FAILED = "pipeline-error-custom-transcriber-failed"
|
193
208
|
SILENCE_TIMED_OUT = "silence-timed-out"
|
194
209
|
SIP_GATEWAY_FAILED_TO_CONNECT_CALL = "sip-gateway-failed-to-connect-call"
|
195
210
|
TWILIO_FAILED_TO_CONNECT_CALL = "twilio-failed-to-connect-call"
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Vapi
|
8
|
+
class CerebrasCredential
|
9
|
+
# @return [String]
|
10
|
+
attr_reader :provider
|
11
|
+
# @return [String] This is not returned in the API.
|
12
|
+
attr_reader :api_key
|
13
|
+
# @return [String] This is the unique identifier for the credential.
|
14
|
+
attr_reader :id
|
15
|
+
# @return [String] This is the unique identifier for the org that this credential belongs to.
|
16
|
+
attr_reader :org_id
|
17
|
+
# @return [DateTime] This is the ISO 8601 date-time string of when the credential was created.
|
18
|
+
attr_reader :created_at
|
19
|
+
# @return [DateTime] This is the ISO 8601 date-time string of when the assistant was last updated.
|
20
|
+
attr_reader :updated_at
|
21
|
+
# @return [String] This is the name of credential. This is just for your reference.
|
22
|
+
attr_reader :name
|
23
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
+
attr_reader :additional_properties
|
25
|
+
# @return [Object]
|
26
|
+
attr_reader :_field_set
|
27
|
+
protected :_field_set
|
28
|
+
|
29
|
+
OMIT = Object.new
|
30
|
+
|
31
|
+
# @param provider [String]
|
32
|
+
# @param api_key [String] This is not returned in the API.
|
33
|
+
# @param id [String] This is the unique identifier for the credential.
|
34
|
+
# @param org_id [String] This is the unique identifier for the org that this credential belongs to.
|
35
|
+
# @param created_at [DateTime] This is the ISO 8601 date-time string of when the credential was created.
|
36
|
+
# @param updated_at [DateTime] This is the ISO 8601 date-time string of when the assistant was last updated.
|
37
|
+
# @param name [String] This is the name of credential. This is just for your reference.
|
38
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
|
+
# @return [Vapi::CerebrasCredential]
|
40
|
+
def initialize(provider:, api_key:, id:, org_id:, created_at:, updated_at:, name: OMIT, additional_properties: nil)
|
41
|
+
@provider = provider
|
42
|
+
@api_key = api_key
|
43
|
+
@id = id
|
44
|
+
@org_id = org_id
|
45
|
+
@created_at = created_at
|
46
|
+
@updated_at = updated_at
|
47
|
+
@name = name if name != OMIT
|
48
|
+
@additional_properties = additional_properties
|
49
|
+
@_field_set = {
|
50
|
+
"provider": provider,
|
51
|
+
"apiKey": api_key,
|
52
|
+
"id": id,
|
53
|
+
"orgId": org_id,
|
54
|
+
"createdAt": created_at,
|
55
|
+
"updatedAt": updated_at,
|
56
|
+
"name": name
|
57
|
+
}.reject do |_k, v|
|
58
|
+
v == OMIT
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Deserialize a JSON object to an instance of CerebrasCredential
|
63
|
+
#
|
64
|
+
# @param json_object [String]
|
65
|
+
# @return [Vapi::CerebrasCredential]
|
66
|
+
def self.from_json(json_object:)
|
67
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
68
|
+
parsed_json = JSON.parse(json_object)
|
69
|
+
provider = parsed_json["provider"]
|
70
|
+
api_key = parsed_json["apiKey"]
|
71
|
+
id = parsed_json["id"]
|
72
|
+
org_id = parsed_json["orgId"]
|
73
|
+
created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
|
74
|
+
updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
|
75
|
+
name = parsed_json["name"]
|
76
|
+
new(
|
77
|
+
provider: provider,
|
78
|
+
api_key: api_key,
|
79
|
+
id: id,
|
80
|
+
org_id: org_id,
|
81
|
+
created_at: created_at,
|
82
|
+
updated_at: updated_at,
|
83
|
+
name: name,
|
84
|
+
additional_properties: struct
|
85
|
+
)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Serialize an instance of CerebrasCredential to a JSON object
|
89
|
+
#
|
90
|
+
# @return [String]
|
91
|
+
def to_json(*_args)
|
92
|
+
@_field_set&.to_json
|
93
|
+
end
|
94
|
+
|
95
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
96
|
+
# hash and check each fields type against the current object's property
|
97
|
+
# definitions.
|
98
|
+
#
|
99
|
+
# @param obj [Object]
|
100
|
+
# @return [Void]
|
101
|
+
def self.validate_raw(obj:)
|
102
|
+
obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.")
|
103
|
+
obj.api_key.is_a?(String) != false || raise("Passed value for field obj.api_key is not the expected type, validation failed.")
|
104
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
105
|
+
obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
|
106
|
+
obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
107
|
+
obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
108
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "open_ai_message"
|
4
|
+
require_relative "create_assistant_dto"
|
5
|
+
require_relative "assistant_overrides"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module Vapi
|
10
|
+
class ChatDto
|
11
|
+
# @return [Array<Vapi::OpenAiMessage>]
|
12
|
+
attr_reader :messages
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :assistant_id
|
15
|
+
# @return [Vapi::CreateAssistantDto]
|
16
|
+
attr_reader :assistant
|
17
|
+
# @return [Vapi::AssistantOverrides]
|
18
|
+
attr_reader :assistant_overrides
|
19
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
+
attr_reader :additional_properties
|
21
|
+
# @return [Object]
|
22
|
+
attr_reader :_field_set
|
23
|
+
protected :_field_set
|
24
|
+
|
25
|
+
OMIT = Object.new
|
26
|
+
|
27
|
+
# @param messages [Array<Vapi::OpenAiMessage>]
|
28
|
+
# @param assistant_id [String]
|
29
|
+
# @param assistant [Vapi::CreateAssistantDto]
|
30
|
+
# @param assistant_overrides [Vapi::AssistantOverrides]
|
31
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
32
|
+
# @return [Vapi::ChatDto]
|
33
|
+
def initialize(messages:, assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT,
|
34
|
+
additional_properties: nil)
|
35
|
+
@messages = messages
|
36
|
+
@assistant_id = assistant_id if assistant_id != OMIT
|
37
|
+
@assistant = assistant if assistant != OMIT
|
38
|
+
@assistant_overrides = assistant_overrides if assistant_overrides != OMIT
|
39
|
+
@additional_properties = additional_properties
|
40
|
+
@_field_set = {
|
41
|
+
"messages": messages,
|
42
|
+
"assistantId": assistant_id,
|
43
|
+
"assistant": assistant,
|
44
|
+
"assistantOverrides": assistant_overrides
|
45
|
+
}.reject do |_k, v|
|
46
|
+
v == OMIT
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Deserialize a JSON object to an instance of ChatDto
|
51
|
+
#
|
52
|
+
# @param json_object [String]
|
53
|
+
# @return [Vapi::ChatDto]
|
54
|
+
def self.from_json(json_object:)
|
55
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
56
|
+
parsed_json = JSON.parse(json_object)
|
57
|
+
messages = parsed_json["messages"]&.map do |item|
|
58
|
+
item = item.to_json
|
59
|
+
Vapi::OpenAiMessage.from_json(json_object: item)
|
60
|
+
end
|
61
|
+
assistant_id = parsed_json["assistantId"]
|
62
|
+
if parsed_json["assistant"].nil?
|
63
|
+
assistant = nil
|
64
|
+
else
|
65
|
+
assistant = parsed_json["assistant"].to_json
|
66
|
+
assistant = Vapi::CreateAssistantDto.from_json(json_object: assistant)
|
67
|
+
end
|
68
|
+
if parsed_json["assistantOverrides"].nil?
|
69
|
+
assistant_overrides = nil
|
70
|
+
else
|
71
|
+
assistant_overrides = parsed_json["assistantOverrides"].to_json
|
72
|
+
assistant_overrides = Vapi::AssistantOverrides.from_json(json_object: assistant_overrides)
|
73
|
+
end
|
74
|
+
new(
|
75
|
+
messages: messages,
|
76
|
+
assistant_id: assistant_id,
|
77
|
+
assistant: assistant,
|
78
|
+
assistant_overrides: assistant_overrides,
|
79
|
+
additional_properties: struct
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Serialize an instance of ChatDto to a JSON object
|
84
|
+
#
|
85
|
+
# @return [String]
|
86
|
+
def to_json(*_args)
|
87
|
+
@_field_set&.to_json
|
88
|
+
end
|
89
|
+
|
90
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
91
|
+
# hash and check each fields type against the current object's property
|
92
|
+
# definitions.
|
93
|
+
#
|
94
|
+
# @param obj [Object]
|
95
|
+
# @return [Void]
|
96
|
+
def self.validate_raw(obj:)
|
97
|
+
obj.messages.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.")
|
98
|
+
obj.assistant_id&.is_a?(String) != false || raise("Passed value for field obj.assistant_id is not the expected type, validation failed.")
|
99
|
+
obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant)
|
100
|
+
obj.assistant_overrides.nil? || Vapi::AssistantOverrides.validate_raw(obj: obj.assistant_overrides)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -4,9 +4,7 @@ require "ostruct"
|
|
4
4
|
require "json"
|
5
5
|
|
6
6
|
module Vapi
|
7
|
-
class
|
8
|
-
# @return [Float] This is the number of credits to add to the subscription.
|
9
|
-
attr_reader :credits
|
7
|
+
class ChatServiceResponse
|
10
8
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
11
9
|
attr_reader :additional_properties
|
12
10
|
# @return [Object]
|
@@ -15,27 +13,23 @@ module Vapi
|
|
15
13
|
|
16
14
|
OMIT = Object.new
|
17
15
|
|
18
|
-
# @param credits [Float] This is the number of credits to add to the subscription.
|
19
16
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
-
# @return [Vapi::
|
21
|
-
def initialize(
|
22
|
-
@credits = credits
|
17
|
+
# @return [Vapi::ChatServiceResponse]
|
18
|
+
def initialize(additional_properties: nil)
|
23
19
|
@additional_properties = additional_properties
|
24
|
-
@_field_set = {
|
20
|
+
@_field_set = {}
|
25
21
|
end
|
26
22
|
|
27
|
-
# Deserialize a JSON object to an instance of
|
23
|
+
# Deserialize a JSON object to an instance of ChatServiceResponse
|
28
24
|
#
|
29
25
|
# @param json_object [String]
|
30
|
-
# @return [Vapi::
|
26
|
+
# @return [Vapi::ChatServiceResponse]
|
31
27
|
def self.from_json(json_object:)
|
32
28
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
33
|
-
|
34
|
-
credits = parsed_json["credits"]
|
35
|
-
new(credits: credits, additional_properties: struct)
|
29
|
+
new(additional_properties: struct)
|
36
30
|
end
|
37
31
|
|
38
|
-
# Serialize an instance of
|
32
|
+
# Serialize an instance of ChatServiceResponse to a JSON object
|
39
33
|
#
|
40
34
|
# @return [String]
|
41
35
|
def to_json(*_args)
|
@@ -48,8 +42,6 @@ module Vapi
|
|
48
42
|
#
|
49
43
|
# @param obj [Object]
|
50
44
|
# @return [Void]
|
51
|
-
def self.validate_raw(obj:)
|
52
|
-
obj.credits.is_a?(Float) != false || raise("Passed value for field obj.credits is not the expected type, validation failed.")
|
53
|
-
end
|
45
|
+
def self.validate_raw(obj:); end
|
54
46
|
end
|
55
47
|
end
|