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
@@ -8,10 +8,7 @@ require_relative "types/blocks_create_request"
|
|
8
8
|
require_relative "types/blocks_create_response"
|
9
9
|
require_relative "types/blocks_get_response"
|
10
10
|
require_relative "types/blocks_delete_response"
|
11
|
-
require_relative "types/
|
12
|
-
require_relative "../types/json_schema"
|
13
|
-
require_relative "types/update_block_dto_tool"
|
14
|
-
require_relative "types/update_block_dto_steps_item"
|
11
|
+
require_relative "types/blocks_update_request"
|
15
12
|
require_relative "types/blocks_update_response"
|
16
13
|
require "async"
|
17
14
|
|
@@ -171,74 +168,7 @@ module Vapi
|
|
171
168
|
end
|
172
169
|
|
173
170
|
# @param id [String]
|
174
|
-
# @param
|
175
|
-
# block is running.Request of type Array<Vapi::Blocks::UpdateBlockDtoMessagesItem>, as a Hash
|
176
|
-
# @param input_schema [Hash] This is the input schema for the block. This is the input the block needs to
|
177
|
-
# run. It's given to the block as `steps[0].input`
|
178
|
-
# These are accessible as variables:
|
179
|
-
# - ({{input.propertyName}}) in context of the block execution (step)
|
180
|
-
# - ({{stepName.input.propertyName}}) in context of the workflowRequest of type Vapi::JsonSchema, as a Hash
|
181
|
-
# * :type (Vapi::JsonSchemaType)
|
182
|
-
# * :items (Hash{String => Object})
|
183
|
-
# * :properties (Hash{String => Object})
|
184
|
-
# * :description (String)
|
185
|
-
# * :required (Array<String>)
|
186
|
-
# @param output_schema [Hash] This is the output schema for the block. This is the output the block will
|
187
|
-
# return to the workflow (`{{stepName.output}}`).
|
188
|
-
# These are accessible as variables:
|
189
|
-
# - ({{output.propertyName}}) in context of the block execution (step)
|
190
|
-
# - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1)
|
191
|
-
# - ({{blockName.output.propertyName}}) in context of the workflow (read caveat
|
192
|
-
# #2)
|
193
|
-
# Caveats:
|
194
|
-
# 1. a workflow can execute a step multiple times. example, if a loop is used in
|
195
|
-
# the graph. {{stepName.output.propertyName}} will reference the latest usage of
|
196
|
-
# the step.
|
197
|
-
# 2. a workflow can execute a block multiple times. example, if a step is called
|
198
|
-
# multiple times or if a block is used in multiple steps.
|
199
|
-
# {{blockName.output.propertyName}} will reference the latest usage of the block.
|
200
|
-
# this liquid variable is just provided for convenience when creating blocks
|
201
|
-
# outside of a workflow with steps.Request of type Vapi::JsonSchema, as a Hash
|
202
|
-
# * :type (Vapi::JsonSchemaType)
|
203
|
-
# * :items (Hash{String => Object})
|
204
|
-
# * :properties (Hash{String => Object})
|
205
|
-
# * :description (String)
|
206
|
-
# * :required (Array<String>)
|
207
|
-
# @param tool [Vapi::Blocks::UpdateBlockDtoTool] This is the tool that the block will call. To use an existing tool, use
|
208
|
-
# `toolId`.
|
209
|
-
# @param steps [Array<Hash>] These are the steps in the workflow.Request of type Array<Vapi::Blocks::UpdateBlockDtoStepsItem>, as a Hash
|
210
|
-
# @param name [String] This is the name of the block. This is just for your reference.
|
211
|
-
# @param instruction [String] This is the instruction to the model.
|
212
|
-
# You can reference any variable in the context of the current block execution
|
213
|
-
# (step):
|
214
|
-
# - "{{input.your-property-name}}" for the current step's input
|
215
|
-
# - "{{your-step-name.output.your-property-name}}" for another step's output (in
|
216
|
-
# the same workflow; read caveat #1)
|
217
|
-
# - "{{your-step-name.input.your-property-name}}" for another step's input (in the
|
218
|
-
# same workflow; read caveat #1)
|
219
|
-
# - "{{your-block-name.output.your-property-name}}" for another block's output (in
|
220
|
-
# the same workflow; read caveat #2)
|
221
|
-
# - "{{your-block-name.input.your-property-name}}" for another block's input (in
|
222
|
-
# the same workflow; read caveat #2)
|
223
|
-
# - "{{workflow.input.your-property-name}}" for the current workflow's input
|
224
|
-
# - "{{global.your-property-name}}" for the global context
|
225
|
-
# This can be as simple or as complex as you want it to be.
|
226
|
-
# - "say hello and ask the user about their day!"
|
227
|
-
# - "collect the user's first and last name"
|
228
|
-
# - "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}.
|
229
|
-
# ask them about their salary and if they might be interested in buying a house.
|
230
|
-
# we offer {{input.offer}}"
|
231
|
-
# Caveats:
|
232
|
-
# 1. a workflow can execute a step multiple times. example, if a loop is used in
|
233
|
-
# the graph. {{stepName.output/input.propertyName}} will reference the latest
|
234
|
-
# usage of the step.
|
235
|
-
# 2. a workflow can execute a block multiple times. example, if a step is called
|
236
|
-
# multiple times or if a block is used in multiple steps.
|
237
|
-
# {{blockName.output/input.propertyName}} will reference the latest usage of the
|
238
|
-
# block. this liquid variable is just provided for convenience when creating
|
239
|
-
# blocks outside of a workflow with steps.
|
240
|
-
# @param tool_id [String] This is the id of the tool that the block will call. To use a transient tool,
|
241
|
-
# use `tool`.
|
171
|
+
# @param request [Vapi::Blocks::BlocksUpdateRequest]
|
242
172
|
# @param request_options [Vapi::RequestOptions]
|
243
173
|
# @return [Vapi::Blocks::BlocksUpdateResponse]
|
244
174
|
# @example
|
@@ -248,8 +178,7 @@ module Vapi
|
|
248
178
|
# token: "YOUR_AUTH_TOKEN"
|
249
179
|
# )
|
250
180
|
# api.blocks.update(id: "id")
|
251
|
-
def update(id:,
|
252
|
-
instruction: nil, tool_id: nil, request_options: nil)
|
181
|
+
def update(id:, request:, request_options: nil)
|
253
182
|
response = @request_client.conn.patch do |req|
|
254
183
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
255
184
|
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
@@ -261,17 +190,7 @@ module Vapi
|
|
261
190
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
262
191
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
263
192
|
end
|
264
|
-
req.body = {
|
265
|
-
**(request_options&.additional_body_parameters || {}),
|
266
|
-
messages: messages,
|
267
|
-
inputSchema: input_schema,
|
268
|
-
outputSchema: output_schema,
|
269
|
-
tool: tool,
|
270
|
-
steps: steps,
|
271
|
-
name: name,
|
272
|
-
instruction: instruction,
|
273
|
-
toolId: tool_id
|
274
|
-
}.compact
|
193
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
275
194
|
req.url "#{@request_client.get_url(request_options: request_options)}/block/#{id}"
|
276
195
|
end
|
277
196
|
Vapi::Blocks::BlocksUpdateResponse.from_json(json_object: response.body)
|
@@ -441,74 +360,7 @@ module Vapi
|
|
441
360
|
end
|
442
361
|
|
443
362
|
# @param id [String]
|
444
|
-
# @param
|
445
|
-
# block is running.Request of type Array<Vapi::Blocks::UpdateBlockDtoMessagesItem>, as a Hash
|
446
|
-
# @param input_schema [Hash] This is the input schema for the block. This is the input the block needs to
|
447
|
-
# run. It's given to the block as `steps[0].input`
|
448
|
-
# These are accessible as variables:
|
449
|
-
# - ({{input.propertyName}}) in context of the block execution (step)
|
450
|
-
# - ({{stepName.input.propertyName}}) in context of the workflowRequest of type Vapi::JsonSchema, as a Hash
|
451
|
-
# * :type (Vapi::JsonSchemaType)
|
452
|
-
# * :items (Hash{String => Object})
|
453
|
-
# * :properties (Hash{String => Object})
|
454
|
-
# * :description (String)
|
455
|
-
# * :required (Array<String>)
|
456
|
-
# @param output_schema [Hash] This is the output schema for the block. This is the output the block will
|
457
|
-
# return to the workflow (`{{stepName.output}}`).
|
458
|
-
# These are accessible as variables:
|
459
|
-
# - ({{output.propertyName}}) in context of the block execution (step)
|
460
|
-
# - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1)
|
461
|
-
# - ({{blockName.output.propertyName}}) in context of the workflow (read caveat
|
462
|
-
# #2)
|
463
|
-
# Caveats:
|
464
|
-
# 1. a workflow can execute a step multiple times. example, if a loop is used in
|
465
|
-
# the graph. {{stepName.output.propertyName}} will reference the latest usage of
|
466
|
-
# the step.
|
467
|
-
# 2. a workflow can execute a block multiple times. example, if a step is called
|
468
|
-
# multiple times or if a block is used in multiple steps.
|
469
|
-
# {{blockName.output.propertyName}} will reference the latest usage of the block.
|
470
|
-
# this liquid variable is just provided for convenience when creating blocks
|
471
|
-
# outside of a workflow with steps.Request of type Vapi::JsonSchema, as a Hash
|
472
|
-
# * :type (Vapi::JsonSchemaType)
|
473
|
-
# * :items (Hash{String => Object})
|
474
|
-
# * :properties (Hash{String => Object})
|
475
|
-
# * :description (String)
|
476
|
-
# * :required (Array<String>)
|
477
|
-
# @param tool [Vapi::Blocks::UpdateBlockDtoTool] This is the tool that the block will call. To use an existing tool, use
|
478
|
-
# `toolId`.
|
479
|
-
# @param steps [Array<Hash>] These are the steps in the workflow.Request of type Array<Vapi::Blocks::UpdateBlockDtoStepsItem>, as a Hash
|
480
|
-
# @param name [String] This is the name of the block. This is just for your reference.
|
481
|
-
# @param instruction [String] This is the instruction to the model.
|
482
|
-
# You can reference any variable in the context of the current block execution
|
483
|
-
# (step):
|
484
|
-
# - "{{input.your-property-name}}" for the current step's input
|
485
|
-
# - "{{your-step-name.output.your-property-name}}" for another step's output (in
|
486
|
-
# the same workflow; read caveat #1)
|
487
|
-
# - "{{your-step-name.input.your-property-name}}" for another step's input (in the
|
488
|
-
# same workflow; read caveat #1)
|
489
|
-
# - "{{your-block-name.output.your-property-name}}" for another block's output (in
|
490
|
-
# the same workflow; read caveat #2)
|
491
|
-
# - "{{your-block-name.input.your-property-name}}" for another block's input (in
|
492
|
-
# the same workflow; read caveat #2)
|
493
|
-
# - "{{workflow.input.your-property-name}}" for the current workflow's input
|
494
|
-
# - "{{global.your-property-name}}" for the global context
|
495
|
-
# This can be as simple or as complex as you want it to be.
|
496
|
-
# - "say hello and ask the user about their day!"
|
497
|
-
# - "collect the user's first and last name"
|
498
|
-
# - "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}.
|
499
|
-
# ask them about their salary and if they might be interested in buying a house.
|
500
|
-
# we offer {{input.offer}}"
|
501
|
-
# Caveats:
|
502
|
-
# 1. a workflow can execute a step multiple times. example, if a loop is used in
|
503
|
-
# the graph. {{stepName.output/input.propertyName}} will reference the latest
|
504
|
-
# usage of the step.
|
505
|
-
# 2. a workflow can execute a block multiple times. example, if a step is called
|
506
|
-
# multiple times or if a block is used in multiple steps.
|
507
|
-
# {{blockName.output/input.propertyName}} will reference the latest usage of the
|
508
|
-
# block. this liquid variable is just provided for convenience when creating
|
509
|
-
# blocks outside of a workflow with steps.
|
510
|
-
# @param tool_id [String] This is the id of the tool that the block will call. To use a transient tool,
|
511
|
-
# use `tool`.
|
363
|
+
# @param request [Vapi::Blocks::BlocksUpdateRequest]
|
512
364
|
# @param request_options [Vapi::RequestOptions]
|
513
365
|
# @return [Vapi::Blocks::BlocksUpdateResponse]
|
514
366
|
# @example
|
@@ -518,8 +370,7 @@ module Vapi
|
|
518
370
|
# token: "YOUR_AUTH_TOKEN"
|
519
371
|
# )
|
520
372
|
# api.blocks.update(id: "id")
|
521
|
-
def update(id:,
|
522
|
-
instruction: nil, tool_id: nil, request_options: nil)
|
373
|
+
def update(id:, request:, request_options: nil)
|
523
374
|
Async do
|
524
375
|
response = @request_client.conn.patch do |req|
|
525
376
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
@@ -532,17 +383,7 @@ module Vapi
|
|
532
383
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
533
384
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
534
385
|
end
|
535
|
-
req.body = {
|
536
|
-
**(request_options&.additional_body_parameters || {}),
|
537
|
-
messages: messages,
|
538
|
-
inputSchema: input_schema,
|
539
|
-
outputSchema: output_schema,
|
540
|
-
tool: tool,
|
541
|
-
steps: steps,
|
542
|
-
name: name,
|
543
|
-
instruction: instruction,
|
544
|
-
toolId: tool_id
|
545
|
-
}.compact
|
386
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
546
387
|
req.url "#{@request_client.get_url(request_options: request_options)}/block/#{id}"
|
547
388
|
end
|
548
389
|
Vapi::Blocks::BlocksUpdateResponse.from_json(json_object: response.body)
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "../../types/update_conversation_block_dto"
|
5
|
+
require_relative "../../types/update_tool_call_block_dto"
|
6
|
+
require_relative "../../types/update_workflow_block_dto"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class Blocks
|
10
|
+
class BlocksUpdateRequest
|
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::Blocks::BlocksUpdateRequest]
|
22
|
+
def initialize(member:, discriminant:)
|
23
|
+
@member = member
|
24
|
+
@discriminant = discriminant
|
25
|
+
end
|
26
|
+
|
27
|
+
# Deserialize a JSON object to an instance of BlocksUpdateRequest
|
28
|
+
#
|
29
|
+
# @param json_object [String]
|
30
|
+
# @return [Vapi::Blocks::BlocksUpdateRequest]
|
31
|
+
def self.from_json(json_object:)
|
32
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
33
|
+
member = case struct.type
|
34
|
+
when "conversation"
|
35
|
+
Vapi::UpdateConversationBlockDto.from_json(json_object: json_object)
|
36
|
+
when "tool-call"
|
37
|
+
Vapi::UpdateToolCallBlockDto.from_json(json_object: json_object)
|
38
|
+
when "workflow"
|
39
|
+
Vapi::UpdateWorkflowBlockDto.from_json(json_object: json_object)
|
40
|
+
else
|
41
|
+
Vapi::UpdateConversationBlockDto.from_json(json_object: json_object)
|
42
|
+
end
|
43
|
+
new(member: member, discriminant: struct.type)
|
44
|
+
end
|
45
|
+
|
46
|
+
# For Union Types, to_json functionality is delegated to the wrapped member.
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
def to_json(*_args)
|
50
|
+
case @discriminant
|
51
|
+
when "conversation"
|
52
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
53
|
+
when "tool-call"
|
54
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
55
|
+
when "workflow"
|
56
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
57
|
+
else
|
58
|
+
{ "type": @discriminant, value: @member }.to_json
|
59
|
+
end
|
60
|
+
@member.to_json
|
61
|
+
end
|
62
|
+
|
63
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
64
|
+
# hash and check each fields type against the current object's property
|
65
|
+
# definitions.
|
66
|
+
#
|
67
|
+
# @param obj [Object]
|
68
|
+
# @return [Void]
|
69
|
+
def self.validate_raw(obj:)
|
70
|
+
case obj.type
|
71
|
+
when "conversation"
|
72
|
+
Vapi::UpdateConversationBlockDto.validate_raw(obj: obj)
|
73
|
+
when "tool-call"
|
74
|
+
Vapi::UpdateToolCallBlockDto.validate_raw(obj: obj)
|
75
|
+
when "workflow"
|
76
|
+
Vapi::UpdateWorkflowBlockDto.validate_raw(obj: obj)
|
77
|
+
else
|
78
|
+
raise("Passed value matched no type within the union, validation failed.")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# For Union Types, is_a? functionality is delegated to the wrapped member.
|
83
|
+
#
|
84
|
+
# @param obj [Object]
|
85
|
+
# @return [Boolean]
|
86
|
+
def is_a?(obj)
|
87
|
+
@member.is_a?(obj)
|
88
|
+
end
|
89
|
+
|
90
|
+
# @param member [Vapi::UpdateConversationBlockDto]
|
91
|
+
# @return [Vapi::Blocks::BlocksUpdateRequest]
|
92
|
+
def self.conversation(member:)
|
93
|
+
new(member: member, discriminant: "conversation")
|
94
|
+
end
|
95
|
+
|
96
|
+
# @param member [Vapi::UpdateToolCallBlockDto]
|
97
|
+
# @return [Vapi::Blocks::BlocksUpdateRequest]
|
98
|
+
def self.tool_call(member:)
|
99
|
+
new(member: member, discriminant: "tool-call")
|
100
|
+
end
|
101
|
+
|
102
|
+
# @param member [Vapi::UpdateWorkflowBlockDto]
|
103
|
+
# @return [Vapi::Blocks::BlocksUpdateRequest]
|
104
|
+
def self.workflow(member:)
|
105
|
+
new(member: member, discriminant: "workflow")
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -105,6 +105,7 @@ module Vapi
|
|
105
105
|
# * :background_denoising_enabled (Boolean)
|
106
106
|
# * :model_output_in_messages_enabled (Boolean)
|
107
107
|
# * :transport_configurations (Array<Vapi::TransportConfigurationTwilio>)
|
108
|
+
# * :credentials (Array<Vapi::CreateAssistantDtoCredentialsItem>)
|
108
109
|
# * :name (String)
|
109
110
|
# * :voicemail_detection (Hash)
|
110
111
|
# * :provider (String)
|
@@ -187,6 +188,7 @@ module Vapi
|
|
187
188
|
# * :background_denoising_enabled (Boolean)
|
188
189
|
# * :model_output_in_messages_enabled (Boolean)
|
189
190
|
# * :transport_configurations (Array<Vapi::TransportConfigurationTwilio>)
|
191
|
+
# * :credentials (Array<Vapi::AssistantOverridesCredentialsItem>)
|
190
192
|
# * :variable_values (Hash{String => Object})
|
191
193
|
# * :name (String)
|
192
194
|
# * :voicemail_detection (Hash)
|
@@ -275,6 +277,7 @@ module Vapi
|
|
275
277
|
# * :background_denoising_enabled (Boolean)
|
276
278
|
# * :model_output_in_messages_enabled (Boolean)
|
277
279
|
# * :transport_configurations (Array<Vapi::TransportConfigurationTwilio>)
|
280
|
+
# * :credentials (Array<Vapi::AssistantOverridesCredentialsItem>)
|
278
281
|
# * :variable_values (Hash{String => Object})
|
279
282
|
# * :name (String)
|
280
283
|
# * :voicemail_detection (Hash)
|
@@ -355,8 +358,11 @@ module Vapi
|
|
355
358
|
# * :name (String)
|
356
359
|
# * :assistant_id (String)
|
357
360
|
# * :squad_id (String)
|
358
|
-
# * :
|
359
|
-
#
|
361
|
+
# * :server (Hash)
|
362
|
+
# * :timeout_seconds (Float)
|
363
|
+
# * :url (String)
|
364
|
+
# * :secret (String)
|
365
|
+
# * :headers (Hash{String => Object})
|
360
366
|
# @param customer_id [String] This is the customer that will be called. To call a transient customer , use
|
361
367
|
# `customer` instead.
|
362
368
|
# Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
@@ -593,6 +599,7 @@ module Vapi
|
|
593
599
|
# * :background_denoising_enabled (Boolean)
|
594
600
|
# * :model_output_in_messages_enabled (Boolean)
|
595
601
|
# * :transport_configurations (Array<Vapi::TransportConfigurationTwilio>)
|
602
|
+
# * :credentials (Array<Vapi::CreateAssistantDtoCredentialsItem>)
|
596
603
|
# * :name (String)
|
597
604
|
# * :voicemail_detection (Hash)
|
598
605
|
# * :provider (String)
|
@@ -675,6 +682,7 @@ module Vapi
|
|
675
682
|
# * :background_denoising_enabled (Boolean)
|
676
683
|
# * :model_output_in_messages_enabled (Boolean)
|
677
684
|
# * :transport_configurations (Array<Vapi::TransportConfigurationTwilio>)
|
685
|
+
# * :credentials (Array<Vapi::AssistantOverridesCredentialsItem>)
|
678
686
|
# * :variable_values (Hash{String => Object})
|
679
687
|
# * :name (String)
|
680
688
|
# * :voicemail_detection (Hash)
|
@@ -763,6 +771,7 @@ module Vapi
|
|
763
771
|
# * :background_denoising_enabled (Boolean)
|
764
772
|
# * :model_output_in_messages_enabled (Boolean)
|
765
773
|
# * :transport_configurations (Array<Vapi::TransportConfigurationTwilio>)
|
774
|
+
# * :credentials (Array<Vapi::AssistantOverridesCredentialsItem>)
|
766
775
|
# * :variable_values (Hash{String => Object})
|
767
776
|
# * :name (String)
|
768
777
|
# * :voicemail_detection (Hash)
|
@@ -843,8 +852,11 @@ module Vapi
|
|
843
852
|
# * :name (String)
|
844
853
|
# * :assistant_id (String)
|
845
854
|
# * :squad_id (String)
|
846
|
-
# * :
|
847
|
-
#
|
855
|
+
# * :server (Hash)
|
856
|
+
# * :timeout_seconds (Float)
|
857
|
+
# * :url (String)
|
858
|
+
# * :secret (String)
|
859
|
+
# * :headers (Hash{String => Object})
|
848
860
|
# @param customer_id [String] This is the customer that will be called. To call a transient customer , use
|
849
861
|
# `customer` instead.
|
850
862
|
# Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
|
@@ -8,6 +8,7 @@ require_relative "types/knowledge_bases_create_request"
|
|
8
8
|
require_relative "types/knowledge_bases_create_response"
|
9
9
|
require_relative "types/knowledge_bases_get_response"
|
10
10
|
require_relative "types/knowledge_bases_delete_response"
|
11
|
+
require_relative "types/knowledge_bases_update_request"
|
11
12
|
require_relative "types/knowledge_bases_update_response"
|
12
13
|
require "async"
|
13
14
|
|
@@ -167,6 +168,7 @@ module Vapi
|
|
167
168
|
end
|
168
169
|
|
169
170
|
# @param id [String]
|
171
|
+
# @param request [Vapi::KnowledgeBases::KnowledgeBasesUpdateRequest]
|
170
172
|
# @param request_options [Vapi::RequestOptions]
|
171
173
|
# @return [Vapi::KnowledgeBases::KnowledgeBasesUpdateResponse]
|
172
174
|
# @example
|
@@ -176,7 +178,7 @@ module Vapi
|
|
176
178
|
# token: "YOUR_AUTH_TOKEN"
|
177
179
|
# )
|
178
180
|
# api.knowledge_bases.update(id: "id")
|
179
|
-
def update(id:, request_options: nil)
|
181
|
+
def update(id:, request:, request_options: nil)
|
180
182
|
response = @request_client.conn.patch do |req|
|
181
183
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
182
184
|
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
@@ -188,9 +190,7 @@ module Vapi
|
|
188
190
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
189
191
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
190
192
|
end
|
191
|
-
|
192
|
-
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
193
|
-
end
|
193
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
194
194
|
req.url "#{@request_client.get_url(request_options: request_options)}/knowledge-base/#{id}"
|
195
195
|
end
|
196
196
|
Vapi::KnowledgeBases::KnowledgeBasesUpdateResponse.from_json(json_object: response.body)
|
@@ -360,6 +360,7 @@ module Vapi
|
|
360
360
|
end
|
361
361
|
|
362
362
|
# @param id [String]
|
363
|
+
# @param request [Vapi::KnowledgeBases::KnowledgeBasesUpdateRequest]
|
363
364
|
# @param request_options [Vapi::RequestOptions]
|
364
365
|
# @return [Vapi::KnowledgeBases::KnowledgeBasesUpdateResponse]
|
365
366
|
# @example
|
@@ -369,7 +370,7 @@ module Vapi
|
|
369
370
|
# token: "YOUR_AUTH_TOKEN"
|
370
371
|
# )
|
371
372
|
# api.knowledge_bases.update(id: "id")
|
372
|
-
def update(id:, request_options: nil)
|
373
|
+
def update(id:, request:, request_options: nil)
|
373
374
|
Async do
|
374
375
|
response = @request_client.conn.patch do |req|
|
375
376
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
@@ -382,9 +383,7 @@ module Vapi
|
|
382
383
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
383
384
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
384
385
|
end
|
385
|
-
|
386
|
-
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
387
|
-
end
|
386
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
388
387
|
req.url "#{@request_client.get_url(request_options: request_options)}/knowledge-base/#{id}"
|
389
388
|
end
|
390
389
|
Vapi::KnowledgeBases::KnowledgeBasesUpdateResponse.from_json(json_object: response.body)
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "../../types/update_trieve_knowledge_base_dto"
|
5
|
+
require_relative "../../types/update_custom_knowledge_base_dto"
|
6
|
+
|
7
|
+
module Vapi
|
8
|
+
class KnowledgeBases
|
9
|
+
class KnowledgeBasesUpdateRequest
|
10
|
+
# @return [Object]
|
11
|
+
attr_reader :member
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :discriminant
|
14
|
+
|
15
|
+
private_class_method :new
|
16
|
+
alias kind_of? is_a?
|
17
|
+
|
18
|
+
# @param member [Object]
|
19
|
+
# @param discriminant [String]
|
20
|
+
# @return [Vapi::KnowledgeBases::KnowledgeBasesUpdateRequest]
|
21
|
+
def initialize(member:, discriminant:)
|
22
|
+
@member = member
|
23
|
+
@discriminant = discriminant
|
24
|
+
end
|
25
|
+
|
26
|
+
# Deserialize a JSON object to an instance of KnowledgeBasesUpdateRequest
|
27
|
+
#
|
28
|
+
# @param json_object [String]
|
29
|
+
# @return [Vapi::KnowledgeBases::KnowledgeBasesUpdateRequest]
|
30
|
+
def self.from_json(json_object:)
|
31
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
32
|
+
member = case struct.provider
|
33
|
+
when "trieve"
|
34
|
+
Vapi::UpdateTrieveKnowledgeBaseDto.from_json(json_object: json_object)
|
35
|
+
when "custom-knowledge-base"
|
36
|
+
Vapi::UpdateCustomKnowledgeBaseDto.from_json(json_object: json_object)
|
37
|
+
else
|
38
|
+
Vapi::UpdateTrieveKnowledgeBaseDto.from_json(json_object: json_object)
|
39
|
+
end
|
40
|
+
new(member: member, discriminant: struct.provider)
|
41
|
+
end
|
42
|
+
|
43
|
+
# For Union Types, to_json functionality is delegated to the wrapped member.
|
44
|
+
#
|
45
|
+
# @return [String]
|
46
|
+
def to_json(*_args)
|
47
|
+
case @discriminant
|
48
|
+
when "trieve"
|
49
|
+
{ **@member.to_json, provider: @discriminant }.to_json
|
50
|
+
when "custom-knowledge-base"
|
51
|
+
{ **@member.to_json, provider: @discriminant }.to_json
|
52
|
+
else
|
53
|
+
{ "provider": @discriminant, value: @member }.to_json
|
54
|
+
end
|
55
|
+
@member.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
|
+
case obj.provider
|
66
|
+
when "trieve"
|
67
|
+
Vapi::UpdateTrieveKnowledgeBaseDto.validate_raw(obj: obj)
|
68
|
+
when "custom-knowledge-base"
|
69
|
+
Vapi::UpdateCustomKnowledgeBaseDto.validate_raw(obj: obj)
|
70
|
+
else
|
71
|
+
raise("Passed value matched no type within the union, validation failed.")
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# For Union Types, is_a? functionality is delegated to the wrapped member.
|
76
|
+
#
|
77
|
+
# @param obj [Object]
|
78
|
+
# @return [Boolean]
|
79
|
+
def is_a?(obj)
|
80
|
+
@member.is_a?(obj)
|
81
|
+
end
|
82
|
+
|
83
|
+
# @param member [Vapi::UpdateTrieveKnowledgeBaseDto]
|
84
|
+
# @return [Vapi::KnowledgeBases::KnowledgeBasesUpdateRequest]
|
85
|
+
def self.trieve(member:)
|
86
|
+
new(member: member, discriminant: "trieve")
|
87
|
+
end
|
88
|
+
|
89
|
+
# @param member [Vapi::UpdateCustomKnowledgeBaseDto]
|
90
|
+
# @return [Vapi::KnowledgeBases::KnowledgeBasesUpdateRequest]
|
91
|
+
def self.custom_knowledge_base(member:)
|
92
|
+
new(member: member, discriminant: "custom-knowledge-base")
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -89,6 +89,47 @@ module Vapi
|
|
89
89
|
end
|
90
90
|
Vapi::LogsPaginatedResponse.from_json(json_object: response.body)
|
91
91
|
end
|
92
|
+
|
93
|
+
# @param org_id [String] This is the unique identifier for the org that this log belongs to.
|
94
|
+
# @param assistant_id [String] This is the ID of the assistant.
|
95
|
+
# @param phone_number_id [String] This is the ID of the phone number.
|
96
|
+
# @param customer_id [String] This is the ID of the customer.
|
97
|
+
# @param squad_id [String] This is the ID of the squad.
|
98
|
+
# @param call_id [String] This is the ID of the call.
|
99
|
+
# @param request_options [Vapi::RequestOptions]
|
100
|
+
# @return [Void]
|
101
|
+
# @example
|
102
|
+
# api = Vapi::Client.new(
|
103
|
+
# base_url: "https://api.example.com",
|
104
|
+
# environment: Vapi::Environment::DEFAULT,
|
105
|
+
# token: "YOUR_AUTH_TOKEN"
|
106
|
+
# )
|
107
|
+
# api.logs.logging_controller_logs_delete_query
|
108
|
+
def logging_controller_logs_delete_query(org_id: nil, assistant_id: nil, phone_number_id: nil, customer_id: nil,
|
109
|
+
squad_id: nil, call_id: nil, request_options: nil)
|
110
|
+
@request_client.conn.delete do |req|
|
111
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
112
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
113
|
+
req.headers = {
|
114
|
+
**(req.headers || {}),
|
115
|
+
**@request_client.get_headers,
|
116
|
+
**(request_options&.additional_headers || {})
|
117
|
+
}.compact
|
118
|
+
req.params = {
|
119
|
+
**(request_options&.additional_query_parameters || {}),
|
120
|
+
"orgId": org_id,
|
121
|
+
"assistantId": assistant_id,
|
122
|
+
"phoneNumberId": phone_number_id,
|
123
|
+
"customerId": customer_id,
|
124
|
+
"squadId": squad_id,
|
125
|
+
"callId": call_id
|
126
|
+
}.compact
|
127
|
+
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
128
|
+
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
129
|
+
end
|
130
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/logs"
|
131
|
+
end
|
132
|
+
end
|
92
133
|
end
|
93
134
|
|
94
135
|
class AsyncLogsClient
|
@@ -174,5 +215,48 @@ module Vapi
|
|
174
215
|
Vapi::LogsPaginatedResponse.from_json(json_object: response.body)
|
175
216
|
end
|
176
217
|
end
|
218
|
+
|
219
|
+
# @param org_id [String] This is the unique identifier for the org that this log belongs to.
|
220
|
+
# @param assistant_id [String] This is the ID of the assistant.
|
221
|
+
# @param phone_number_id [String] This is the ID of the phone number.
|
222
|
+
# @param customer_id [String] This is the ID of the customer.
|
223
|
+
# @param squad_id [String] This is the ID of the squad.
|
224
|
+
# @param call_id [String] This is the ID of the call.
|
225
|
+
# @param request_options [Vapi::RequestOptions]
|
226
|
+
# @return [Void]
|
227
|
+
# @example
|
228
|
+
# api = Vapi::Client.new(
|
229
|
+
# base_url: "https://api.example.com",
|
230
|
+
# environment: Vapi::Environment::DEFAULT,
|
231
|
+
# token: "YOUR_AUTH_TOKEN"
|
232
|
+
# )
|
233
|
+
# api.logs.logging_controller_logs_delete_query
|
234
|
+
def logging_controller_logs_delete_query(org_id: nil, assistant_id: nil, phone_number_id: nil, customer_id: nil,
|
235
|
+
squad_id: nil, call_id: nil, request_options: nil)
|
236
|
+
Async do
|
237
|
+
@request_client.conn.delete do |req|
|
238
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
239
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
240
|
+
req.headers = {
|
241
|
+
**(req.headers || {}),
|
242
|
+
**@request_client.get_headers,
|
243
|
+
**(request_options&.additional_headers || {})
|
244
|
+
}.compact
|
245
|
+
req.params = {
|
246
|
+
**(request_options&.additional_query_parameters || {}),
|
247
|
+
"orgId": org_id,
|
248
|
+
"assistantId": assistant_id,
|
249
|
+
"phoneNumberId": phone_number_id,
|
250
|
+
"customerId": customer_id,
|
251
|
+
"squadId": squad_id,
|
252
|
+
"callId": call_id
|
253
|
+
}.compact
|
254
|
+
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
255
|
+
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
256
|
+
end
|
257
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/logs"
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
177
261
|
end
|
178
262
|
end
|