vapi_server_sdk 0.0.0.pre.alpha7 → 0.2.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 -10
- data/lib/types_export.rb +184 -26
- data/lib/vapi_server_sdk/analytics/client.rb +14 -43
- data/lib/vapi_server_sdk/assistants/client.rb +57 -60
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_client_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_model.rb +39 -0
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_transcriber.rb +27 -1
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb +26 -0
- data/lib/vapi_server_sdk/calls/client.rb +58 -28
- data/lib/vapi_server_sdk/knowledge_bases/client.rb +394 -0
- data/lib/vapi_server_sdk/knowledge_bases/types/knowledge_bases_create_request.rb +96 -0
- data/lib/vapi_server_sdk/knowledge_bases/types/knowledge_bases_create_response.rb +96 -0
- data/lib/vapi_server_sdk/knowledge_bases/types/knowledge_bases_delete_response.rb +96 -0
- data/lib/vapi_server_sdk/knowledge_bases/types/knowledge_bases_get_response.rb +96 -0
- data/lib/vapi_server_sdk/knowledge_bases/types/knowledge_bases_list_response_item.rb +96 -0
- data/lib/vapi_server_sdk/knowledge_bases/types/knowledge_bases_update_response.rb +96 -0
- data/lib/vapi_server_sdk/logs/client.rb +10 -6
- data/lib/vapi_server_sdk/squads/client.rb +56 -32
- data/lib/vapi_server_sdk/tools/client.rb +4 -0
- data/lib/vapi_server_sdk/tools/types/tools_create_request.rb +39 -0
- data/lib/vapi_server_sdk/tools/types/tools_create_response.rb +39 -0
- data/lib/vapi_server_sdk/tools/types/tools_delete_response.rb +39 -0
- data/lib/vapi_server_sdk/tools/types/tools_get_response.rb +39 -0
- data/lib/vapi_server_sdk/tools/types/tools_list_response_item.rb +39 -0
- data/lib/vapi_server_sdk/tools/types/tools_update_response.rb +39 -0
- data/lib/vapi_server_sdk/types/analytics_query_dto.rb +59 -0
- data/lib/vapi_server_sdk/types/anthropic_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/anthropic_model.rb +21 -13
- data/lib/vapi_server_sdk/types/anthropic_model_model.rb +2 -0
- data/lib/vapi_server_sdk/types/anyscale_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/anyscale_model.rb +21 -13
- data/lib/vapi_server_sdk/types/assembly_ai_credential.rb +111 -0
- data/lib/vapi_server_sdk/types/assembly_ai_transcriber.rb +97 -0
- data/lib/vapi_server_sdk/types/assistant.rb +42 -64
- data/lib/vapi_server_sdk/types/assistant_client_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/assistant_custom_endpointing_rule.rb +100 -0
- data/lib/vapi_server_sdk/types/assistant_model.rb +39 -0
- data/lib/vapi_server_sdk/types/assistant_overrides.rb +57 -65
- data/lib/vapi_server_sdk/types/assistant_overrides_client_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/assistant_overrides_model.rb +39 -0
- data/lib/vapi_server_sdk/types/assistant_overrides_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/assistant_overrides_transcriber.rb +27 -1
- data/lib/vapi_server_sdk/types/assistant_overrides_voice.rb +26 -0
- data/lib/vapi_server_sdk/types/assistant_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/assistant_transcriber.rb +27 -1
- data/lib/vapi_server_sdk/types/assistant_voice.rb +26 -0
- data/lib/vapi_server_sdk/types/auto_reload_plan.rb +65 -0
- data/lib/vapi_server_sdk/types/auto_reload_plan_dto.rb +65 -0
- data/lib/vapi_server_sdk/types/azure_credential.rb +129 -0
- data/lib/vapi_server_sdk/types/azure_credential_region.rb +23 -0
- data/lib/vapi_server_sdk/types/azure_open_ai_credential.rb +12 -2
- data/lib/vapi_server_sdk/types/azure_open_ai_credential_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/azure_open_ai_credential_region.rb +1 -0
- data/lib/vapi_server_sdk/types/azure_voice.rb +25 -21
- data/lib/vapi_server_sdk/types/bash_tool.rb +194 -0
- data/lib/vapi_server_sdk/types/bash_tool_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/block_complete_message.rb +29 -4
- data/lib/vapi_server_sdk/types/block_start_message.rb +29 -4
- data/lib/vapi_server_sdk/types/both_custom_endpointing_rule.rb +126 -0
- data/lib/vapi_server_sdk/types/byo_sip_trunk_credential.rb +29 -9
- data/lib/vapi_server_sdk/types/call.rb +15 -1
- data/lib/vapi_server_sdk/types/call_ended_reason.rb +49 -24
- data/lib/vapi_server_sdk/types/call_log_privileged.rb +88 -0
- data/lib/vapi_server_sdk/types/call_log_privileged_level.rb +12 -0
- data/lib/vapi_server_sdk/types/call_logs_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/cartesia_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/cartesia_voice.rb +25 -21
- data/lib/vapi_server_sdk/types/cartesia_voice_language.rb +9 -1
- data/lib/vapi_server_sdk/types/client_inbound_message_add_message.rb +25 -3
- data/lib/vapi_server_sdk/types/client_inbound_message_message.rb +13 -0
- data/lib/vapi_server_sdk/types/client_inbound_message_transfer.rb +63 -0
- data/lib/vapi_server_sdk/types/client_inbound_message_transfer_destination.rb +96 -0
- data/lib/vapi_server_sdk/types/{client_message_language_changed.rb → client_message_language_change_detected.rb} +5 -5
- data/lib/vapi_server_sdk/types/client_message_message.rb +22 -9
- data/lib/vapi_server_sdk/types/client_message_tool_calls_tool_with_tool_call_list_item.rb +77 -77
- data/lib/vapi_server_sdk/types/client_message_transfer_update.rb +116 -0
- data/lib/vapi_server_sdk/types/client_message_transfer_update_destination.rb +122 -0
- data/lib/vapi_server_sdk/types/computer_tool.rb +218 -0
- data/lib/vapi_server_sdk/types/computer_tool_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/condition.rb +9 -9
- data/lib/vapi_server_sdk/types/create_anthropic_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_anyscale_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_assembly_ai_credential_dto.rb +74 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto.rb +43 -65
- data/lib/vapi_server_sdk/types/create_assistant_dto_client_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto_model.rb +39 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto_transcriber.rb +27 -1
- data/lib/vapi_server_sdk/types/create_assistant_dto_voice.rb +26 -0
- data/lib/vapi_server_sdk/types/create_azure_credential_dto.rb +95 -0
- data/lib/vapi_server_sdk/types/create_azure_credential_dto_region.rb +23 -0
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb +13 -3
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_region.rb +1 -0
- data/lib/vapi_server_sdk/types/create_bash_tool_dto.rb +161 -0
- data/lib/vapi_server_sdk/types/create_bash_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb +31 -11
- data/lib/vapi_server_sdk/types/create_cartesia_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_computer_tool_dto.rb +185 -0
- data/lib/vapi_server_sdk/types/create_computer_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/create_custom_knowledge_base_dto.rb +137 -0
- data/lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb +31 -2
- data/lib/vapi_server_sdk/types/create_deep_infra_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_deepgram_credential_dto.rb +9 -2
- data/lib/vapi_server_sdk/types/create_eleven_labs_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_gcp_credential_dto.rb +10 -10
- data/lib/vapi_server_sdk/types/create_gladia_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_go_high_level_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_google_credential_dto.rb +76 -0
- data/lib/vapi_server_sdk/types/create_groq_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_inflection_ai_credential_dto.rb +76 -0
- data/lib/vapi_server_sdk/types/create_langfuse_credential_dto.rb +96 -0
- data/lib/vapi_server_sdk/types/create_lmnt_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_make_credential_dto.rb +17 -2
- data/lib/vapi_server_sdk/types/create_open_ai_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_open_router_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_org_dto.rb +21 -2
- data/lib/vapi_server_sdk/types/create_org_dto_channel.rb +10 -0
- data/lib/vapi_server_sdk/types/create_perplexity_ai_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_play_ht_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_rime_ai_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_runpod_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_s_3_credential_dto.rb +13 -3
- data/lib/vapi_server_sdk/types/{knowledge_base.rb → create_tavus_credential_dto.rb} +21 -21
- data/lib/vapi_server_sdk/types/create_text_editor_tool_dto.rb +161 -0
- data/lib/vapi_server_sdk/types/create_text_editor_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/create_together_ai_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/create_trieve_knowledge_base_dto.rb +109 -0
- data/lib/vapi_server_sdk/types/create_twilio_credential_dto.rb +16 -2
- data/lib/vapi_server_sdk/types/create_vapi_phone_number_dto.rb +20 -2
- data/lib/vapi_server_sdk/types/create_vonage_credential_dto.rb +16 -2
- data/lib/vapi_server_sdk/types/create_webhook_credential_dto.rb +84 -0
- data/lib/vapi_server_sdk/types/create_x_ai_credential_dto.rb +76 -0
- data/lib/vapi_server_sdk/types/credits_buy_dto.rb +55 -0
- data/lib/vapi_server_sdk/types/custom_knowledge_base.rb +154 -0
- data/lib/vapi_server_sdk/types/custom_llm_credential.rb +46 -3
- data/lib/vapi_server_sdk/types/custom_llm_model.rb +23 -15
- data/lib/vapi_server_sdk/types/custom_message.rb +92 -0
- data/lib/vapi_server_sdk/types/custom_transcriber.rb +125 -0
- data/lib/vapi_server_sdk/types/custom_voice.rb +132 -0
- data/lib/vapi_server_sdk/types/customer_custom_endpointing_rule.rb +100 -0
- data/lib/vapi_server_sdk/types/deep_infra_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/deep_infra_model.rb +21 -13
- data/lib/vapi_server_sdk/types/deepgram_credential.rb +9 -1
- data/lib/vapi_server_sdk/types/deepgram_transcriber.rb +69 -11
- data/lib/vapi_server_sdk/types/deepgram_voice.rb +17 -17
- data/lib/vapi_server_sdk/types/eleven_labs_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/eleven_labs_voice.rb +28 -24
- data/lib/vapi_server_sdk/types/fallback_azure_voice.rb +100 -0
- data/lib/vapi_server_sdk/types/fallback_azure_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/fallback_azure_voice_voice_id.rb +9 -0
- data/lib/vapi_server_sdk/types/fallback_cartesia_voice.rb +100 -0
- data/lib/vapi_server_sdk/types/fallback_cartesia_voice_language.rb +23 -0
- data/lib/vapi_server_sdk/types/fallback_cartesia_voice_model.rb +10 -0
- data/lib/vapi_server_sdk/types/fallback_custom_voice.rb +117 -0
- data/lib/vapi_server_sdk/types/fallback_deepgram_voice.rb +81 -0
- data/lib/vapi_server_sdk/types/fallback_deepgram_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/fallback_deepgram_voice_id_enum.rb +18 -0
- data/lib/vapi_server_sdk/types/fallback_eleven_labs_voice.rb +164 -0
- data/lib/vapi_server_sdk/types/fallback_eleven_labs_voice_id.rb +54 -0
- data/lib/vapi_server_sdk/types/fallback_eleven_labs_voice_id_enum.rb +21 -0
- data/lib/vapi_server_sdk/types/fallback_eleven_labs_voice_model.rb +12 -0
- data/lib/vapi_server_sdk/types/fallback_lmnt_voice.rb +88 -0
- data/lib/vapi_server_sdk/types/fallback_lmnt_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/fallback_lmnt_voice_id_enum.rb +8 -0
- data/lib/vapi_server_sdk/types/fallback_neets_voice.rb +81 -0
- data/lib/vapi_server_sdk/types/fallback_neets_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/fallback_neets_voice_id_enum.rb +7 -0
- data/lib/vapi_server_sdk/types/fallback_open_ai_voice.rb +87 -0
- data/lib/vapi_server_sdk/types/fallback_open_ai_voice_id.rb +20 -0
- data/lib/vapi_server_sdk/types/fallback_plan.rb +61 -0
- data/lib/vapi_server_sdk/types/fallback_plan_voices_item.rb +211 -0
- data/lib/vapi_server_sdk/types/fallback_play_ht_voice.rb +172 -0
- data/lib/vapi_server_sdk/types/fallback_play_ht_voice_emotion.rb +19 -0
- data/lib/vapi_server_sdk/types/fallback_play_ht_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/fallback_play_ht_voice_id_enum.rb +16 -0
- data/lib/vapi_server_sdk/types/fallback_play_ht_voice_language.rb +44 -0
- data/lib/vapi_server_sdk/types/fallback_play_ht_voice_model.rb +10 -0
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice.rb +96 -0
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_id_enum.rb +87 -0
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_model.rb +9 -0
- data/lib/vapi_server_sdk/types/fallback_tavus_voice.rb +147 -0
- data/lib/vapi_server_sdk/types/fallback_tavus_voice_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/format_plan.rb +0 -2
- data/lib/vapi_server_sdk/types/function_tool_with_tool_call.rb +10 -1
- data/lib/vapi_server_sdk/types/gcp_credential.rb +2 -2
- data/lib/vapi_server_sdk/types/ghl_tool_with_tool_call.rb +9 -1
- data/lib/vapi_server_sdk/types/gladia_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/go_high_level_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/google_credential.rb +113 -0
- data/lib/vapi_server_sdk/types/google_model.rb +178 -0
- data/lib/vapi_server_sdk/types/google_model_model.rb +12 -0
- data/lib/vapi_server_sdk/types/google_model_tools_item.rb +159 -0
- data/lib/vapi_server_sdk/types/groq_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/groq_model.rb +21 -13
- data/lib/vapi_server_sdk/types/hipaa_buy_dto.rb +65 -0
- data/lib/vapi_server_sdk/types/inflection_ai_credential.rb +113 -0
- data/lib/vapi_server_sdk/types/inflection_ai_model.rb +177 -0
- data/lib/vapi_server_sdk/types/inflection_ai_model_tools_item.rb +159 -0
- data/lib/vapi_server_sdk/types/invite_user_dto.rb +9 -9
- data/lib/vapi_server_sdk/types/knowledge_base_response_document.rb +74 -0
- data/lib/vapi_server_sdk/types/langfuse_credential.rb +130 -0
- data/lib/vapi_server_sdk/types/lmnt_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/lmnt_voice.rb +18 -14
- data/lib/vapi_server_sdk/types/log.rb +12 -4
- data/lib/vapi_server_sdk/types/log_resource.rb +8 -0
- data/lib/vapi_server_sdk/types/make_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/make_tool_with_tool_call.rb +9 -1
- data/lib/vapi_server_sdk/types/neets_voice.rb +17 -17
- data/lib/vapi_server_sdk/types/o_auth_2_authentication_plan.rb +79 -0
- data/lib/vapi_server_sdk/types/oauth_2_authentication_session.rb +68 -0
- data/lib/vapi_server_sdk/types/open_ai_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/open_ai_function.rb +30 -4
- data/lib/vapi_server_sdk/types/open_ai_model.rb +23 -15
- data/lib/vapi_server_sdk/types/open_ai_model_fallback_models_item.rb +2 -0
- data/lib/vapi_server_sdk/types/open_ai_model_model.rb +2 -0
- data/lib/vapi_server_sdk/types/open_ai_voice.rb +22 -14
- data/lib/vapi_server_sdk/types/open_ai_voice_id.rb +7 -0
- data/lib/vapi_server_sdk/types/open_router_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/open_router_model.rb +21 -13
- data/lib/vapi_server_sdk/types/org.rb +35 -2
- data/lib/vapi_server_sdk/types/org_channel.rb +10 -0
- data/lib/vapi_server_sdk/types/org_with_org_user.rb +262 -0
- data/lib/vapi_server_sdk/types/org_with_org_user_channel.rb +10 -0
- data/lib/vapi_server_sdk/types/org_with_org_user_role.rb +9 -0
- data/lib/vapi_server_sdk/types/payment.rb +167 -0
- data/lib/vapi_server_sdk/types/payment_retry_dto.rb +55 -0
- data/lib/vapi_server_sdk/types/payment_status.rb +11 -0
- data/lib/vapi_server_sdk/types/payments_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/perplexity_ai_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/perplexity_ai_model.rb +21 -13
- data/lib/vapi_server_sdk/types/phone_number_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/phone_number_paginated_response_results_item.rb +121 -0
- data/lib/vapi_server_sdk/types/play_ht_credential.rb +13 -2
- data/lib/vapi_server_sdk/types/play_ht_voice.rb +37 -15
- data/lib/vapi_server_sdk/types/play_ht_voice_language.rb +44 -0
- data/lib/vapi_server_sdk/types/play_ht_voice_model.rb +10 -0
- data/lib/vapi_server_sdk/types/regex_option.rb +2 -2
- data/lib/vapi_server_sdk/types/regex_option_type.rb +1 -1
- data/lib/vapi_server_sdk/types/regex_replacement.rb +14 -4
- data/lib/vapi_server_sdk/types/rime_ai_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/rime_ai_voice.rb +18 -14
- data/lib/vapi_server_sdk/types/runpod_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/s_3_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/server.rb +16 -2
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report_ended_reason.rb +49 -24
- data/lib/vapi_server_sdk/types/server_message_knowledge_base_request.rb +195 -0
- data/lib/vapi_server_sdk/types/server_message_knowledge_base_request_messages_item.rb +97 -0
- data/lib/vapi_server_sdk/types/{server_message_language_changed_phone_number.rb → server_message_knowledge_base_request_phone_number.rb} +8 -8
- data/lib/vapi_server_sdk/types/{server_message_language_changed.rb → server_message_language_change_detected.rb} +10 -10
- data/lib/vapi_server_sdk/types/server_message_language_change_detected_phone_number.rb +125 -0
- data/lib/vapi_server_sdk/types/server_message_message.rb +22 -9
- data/lib/vapi_server_sdk/types/server_message_response_knowledge_base_request.rb +81 -0
- data/lib/vapi_server_sdk/types/server_message_response_message_response.rb +14 -0
- data/lib/vapi_server_sdk/types/server_message_status_update_ended_reason.rb +49 -24
- data/lib/vapi_server_sdk/types/server_message_tool_calls_tool_with_tool_call_list_item.rb +77 -77
- data/lib/vapi_server_sdk/types/server_message_transfer_update.rb +18 -2
- data/lib/vapi_server_sdk/types/sip_authentication.rb +80 -0
- data/lib/vapi_server_sdk/types/start_speaking_plan.rb +54 -10
- data/lib/vapi_server_sdk/types/start_speaking_plan_custom_endpointing_rules_item.rb +108 -0
- data/lib/vapi_server_sdk/types/structured_data_plan.rb +28 -10
- data/lib/vapi_server_sdk/types/subscription.rb +336 -0
- data/lib/vapi_server_sdk/types/subscription_concurrency_line_buy_dto.rb +55 -0
- data/lib/vapi_server_sdk/types/subscription_concurrency_line_remove_dto.rb +55 -0
- data/lib/vapi_server_sdk/types/subscription_coupon_add_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/subscription_monthly_charge.rb +65 -0
- data/lib/vapi_server_sdk/types/subscription_status.rb +10 -0
- data/lib/vapi_server_sdk/types/subscription_type.rb +10 -0
- data/lib/vapi_server_sdk/types/success_evaluation_plan.rb +38 -16
- data/lib/vapi_server_sdk/types/summary_plan.rb +26 -8
- data/lib/vapi_server_sdk/types/sync_voice_library_dto_providers_item.rb +1 -0
- data/lib/vapi_server_sdk/types/tavus_conversation_properties.rb +173 -0
- data/lib/vapi_server_sdk/types/tavus_credential.rb +111 -0
- data/lib/vapi_server_sdk/types/tavus_voice.rb +163 -0
- data/lib/vapi_server_sdk/types/tavus_voice_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/text_content.rb +73 -0
- data/lib/vapi_server_sdk/types/text_content_language.rb +191 -0
- data/lib/vapi_server_sdk/types/text_editor_tool.rb +194 -0
- data/lib/vapi_server_sdk/types/text_editor_tool_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/together_ai_credential.rb +13 -3
- data/lib/vapi_server_sdk/types/together_ai_model.rb +21 -13
- data/lib/vapi_server_sdk/types/tool_message_complete.rb +29 -3
- data/lib/vapi_server_sdk/types/tool_message_delayed.rb +30 -3
- data/lib/vapi_server_sdk/types/tool_message_failed.rb +30 -3
- data/lib/vapi_server_sdk/types/tool_message_start.rb +29 -4
- data/lib/vapi_server_sdk/types/transfer_destination_assistant.rb +79 -33
- data/lib/vapi_server_sdk/types/transfer_destination_assistant_message.rb +65 -0
- data/lib/vapi_server_sdk/types/transfer_destination_number.rb +56 -24
- data/lib/vapi_server_sdk/types/transfer_destination_number_message.rb +65 -0
- data/lib/vapi_server_sdk/types/transfer_destination_sip.rb +60 -15
- data/lib/vapi_server_sdk/types/transfer_destination_sip_message.rb +65 -0
- data/lib/vapi_server_sdk/types/transfer_destination_step.rb +28 -14
- data/lib/vapi_server_sdk/types/transfer_destination_step_message.rb +65 -0
- data/lib/vapi_server_sdk/types/transfer_plan.rb +141 -0
- data/lib/vapi_server_sdk/types/transfer_plan_message.rb +58 -0
- data/lib/vapi_server_sdk/types/transfer_plan_mode.rb +32 -0
- data/lib/vapi_server_sdk/types/transport.rb +70 -0
- data/lib/vapi_server_sdk/types/transport_cost.rb +12 -2
- data/lib/vapi_server_sdk/types/transport_cost_provider.rb +9 -0
- data/lib/vapi_server_sdk/types/transport_provider.rb +11 -0
- data/lib/vapi_server_sdk/types/trieve_knowledge_base.rb +125 -0
- data/lib/vapi_server_sdk/types/trieve_knowledge_base_vector_store_create_plan.rb +109 -0
- data/lib/vapi_server_sdk/types/trieve_knowledge_base_vector_store_search_plan.rb +95 -0
- data/lib/vapi_server_sdk/types/trieve_knowledge_base_vector_store_search_plan_search_type.rb +12 -0
- data/lib/vapi_server_sdk/types/twilio_credential.rb +12 -2
- data/lib/vapi_server_sdk/types/update_anthropic_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_anyscale_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_assembly_ai_credential_dto.rb +74 -0
- data/lib/vapi_server_sdk/types/update_azure_credential_dto.rb +95 -0
- data/lib/vapi_server_sdk/types/update_azure_credential_dto_region.rb +23 -0
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto.rb +13 -3
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_region.rb +1 -0
- data/lib/vapi_server_sdk/types/update_byo_sip_trunk_credential_dto.rb +31 -11
- data/lib/vapi_server_sdk/types/update_cartesia_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_custom_llm_credential_dto.rb +31 -2
- data/lib/vapi_server_sdk/types/update_deep_infra_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_deepgram_credential_dto.rb +9 -2
- data/lib/vapi_server_sdk/types/update_eleven_labs_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_gcp_credential_dto.rb +10 -10
- data/lib/vapi_server_sdk/types/update_gladia_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_go_high_level_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_google_credential_dto.rb +76 -0
- data/lib/vapi_server_sdk/types/update_groq_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_inflection_ai_credential_dto.rb +76 -0
- data/lib/vapi_server_sdk/types/update_langfuse_credential_dto.rb +96 -0
- data/lib/vapi_server_sdk/types/update_lmnt_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_make_credential_dto.rb +17 -2
- data/lib/vapi_server_sdk/types/update_open_ai_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_open_router_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_org_dto.rb +21 -2
- data/lib/vapi_server_sdk/types/update_org_dto_channel.rb +10 -0
- data/lib/vapi_server_sdk/types/update_perplexity_ai_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_play_ht_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_rime_ai_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_runpod_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_s_3_credential_dto.rb +13 -3
- data/lib/vapi_server_sdk/types/update_tavus_credential_dto.rb +74 -0
- data/lib/vapi_server_sdk/types/update_together_ai_credential_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/update_twilio_credential_dto.rb +16 -2
- data/lib/vapi_server_sdk/types/update_vonage_credential_dto.rb +16 -2
- data/lib/vapi_server_sdk/types/update_x_ai_credential_dto.rb +76 -0
- data/lib/vapi_server_sdk/types/vapi_cost.rb +10 -2
- data/lib/vapi_server_sdk/types/vapi_cost_sub_type.rb +9 -0
- data/lib/vapi_server_sdk/types/vapi_model.rb +24 -16
- data/lib/vapi_server_sdk/types/vapi_phone_number.rb +20 -2
- data/lib/vapi_server_sdk/types/vonage_credential.rb +12 -2
- data/lib/vapi_server_sdk/types/webhook_credential.rb +134 -0
- data/lib/vapi_server_sdk/types/x_ai_credential.rb +113 -0
- data/lib/vapi_server_sdk/types/xai_model.rb +177 -0
- data/lib/vapi_server_sdk/types/xai_model_tools_item.rb +159 -0
- data/lib/vapi_server_sdk.rb +7 -0
- metadata +167 -8
@@ -18,6 +18,8 @@ module Vapi
|
|
18
18
|
attr_reader :created_at
|
19
19
|
# @return [DateTime] This is the ISO 8601 date-time string of when the assistant was last updated.
|
20
20
|
attr_reader :updated_at
|
21
|
+
# @return [String] This is the name of credential. This is just for your reference.
|
22
|
+
attr_reader :name
|
21
23
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
22
24
|
attr_reader :additional_properties
|
23
25
|
# @return [Object]
|
@@ -32,15 +34,17 @@ module Vapi
|
|
32
34
|
# @param org_id [String] This is the unique identifier for the org that this credential belongs to.
|
33
35
|
# @param created_at [DateTime] This is the ISO 8601 date-time string of when the credential was created.
|
34
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.
|
35
38
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
36
39
|
# @return [Vapi::RunpodCredential]
|
37
|
-
def initialize(provider:, api_key:, id:, org_id:, created_at:, updated_at:, additional_properties: nil)
|
40
|
+
def initialize(provider:, api_key:, id:, org_id:, created_at:, updated_at:, name: OMIT, additional_properties: nil)
|
38
41
|
@provider = provider
|
39
42
|
@api_key = api_key
|
40
43
|
@id = id
|
41
44
|
@org_id = org_id
|
42
45
|
@created_at = created_at
|
43
46
|
@updated_at = updated_at
|
47
|
+
@name = name if name != OMIT
|
44
48
|
@additional_properties = additional_properties
|
45
49
|
@_field_set = {
|
46
50
|
"provider": provider,
|
@@ -48,8 +52,11 @@ module Vapi
|
|
48
52
|
"id": id,
|
49
53
|
"orgId": org_id,
|
50
54
|
"createdAt": created_at,
|
51
|
-
"updatedAt": updated_at
|
52
|
-
|
55
|
+
"updatedAt": updated_at,
|
56
|
+
"name": name
|
57
|
+
}.reject do |_k, v|
|
58
|
+
v == OMIT
|
59
|
+
end
|
53
60
|
end
|
54
61
|
|
55
62
|
# Deserialize a JSON object to an instance of RunpodCredential
|
@@ -65,6 +72,7 @@ module Vapi
|
|
65
72
|
org_id = parsed_json["orgId"]
|
66
73
|
created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
|
67
74
|
updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
|
75
|
+
name = parsed_json["name"]
|
68
76
|
new(
|
69
77
|
provider: provider,
|
70
78
|
api_key: api_key,
|
@@ -72,6 +80,7 @@ module Vapi
|
|
72
80
|
org_id: org_id,
|
73
81
|
created_at: created_at,
|
74
82
|
updated_at: updated_at,
|
83
|
+
name: name,
|
75
84
|
additional_properties: struct
|
76
85
|
)
|
77
86
|
end
|
@@ -96,6 +105,7 @@ module Vapi
|
|
96
105
|
obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
|
97
106
|
obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
98
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.")
|
99
109
|
end
|
100
110
|
end
|
101
111
|
end
|
@@ -26,6 +26,8 @@ module Vapi
|
|
26
26
|
attr_reader :created_at
|
27
27
|
# @return [DateTime] This is the ISO 8601 date-time string of when the assistant was last updated.
|
28
28
|
attr_reader :updated_at
|
29
|
+
# @return [String] This is the name of credential. This is just for your reference.
|
30
|
+
attr_reader :name
|
29
31
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
30
32
|
attr_reader :additional_properties
|
31
33
|
# @return [Object]
|
@@ -44,10 +46,11 @@ module Vapi
|
|
44
46
|
# @param org_id [String] This is the unique identifier for the org that this credential belongs to.
|
45
47
|
# @param created_at [DateTime] This is the ISO 8601 date-time string of when the credential was created.
|
46
48
|
# @param updated_at [DateTime] This is the ISO 8601 date-time string of when the assistant was last updated.
|
49
|
+
# @param name [String] This is the name of credential. This is just for your reference.
|
47
50
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
48
51
|
# @return [Vapi::S3Credential]
|
49
52
|
def initialize(provider:, aws_access_key_id:, aws_secret_access_key:, region:, s_3_bucket_name:, s_3_path_prefix:,
|
50
|
-
id:, org_id:, created_at:, updated_at:, additional_properties: nil)
|
53
|
+
id:, org_id:, created_at:, updated_at:, name: OMIT, additional_properties: nil)
|
51
54
|
@provider = provider
|
52
55
|
@aws_access_key_id = aws_access_key_id
|
53
56
|
@aws_secret_access_key = aws_secret_access_key
|
@@ -58,6 +61,7 @@ module Vapi
|
|
58
61
|
@org_id = org_id
|
59
62
|
@created_at = created_at
|
60
63
|
@updated_at = updated_at
|
64
|
+
@name = name if name != OMIT
|
61
65
|
@additional_properties = additional_properties
|
62
66
|
@_field_set = {
|
63
67
|
"provider": provider,
|
@@ -69,8 +73,11 @@ module Vapi
|
|
69
73
|
"id": id,
|
70
74
|
"orgId": org_id,
|
71
75
|
"createdAt": created_at,
|
72
|
-
"updatedAt": updated_at
|
73
|
-
|
76
|
+
"updatedAt": updated_at,
|
77
|
+
"name": name
|
78
|
+
}.reject do |_k, v|
|
79
|
+
v == OMIT
|
80
|
+
end
|
74
81
|
end
|
75
82
|
|
76
83
|
# Deserialize a JSON object to an instance of S3Credential
|
@@ -90,6 +97,7 @@ module Vapi
|
|
90
97
|
org_id = parsed_json["orgId"]
|
91
98
|
created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
|
92
99
|
updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
|
100
|
+
name = parsed_json["name"]
|
93
101
|
new(
|
94
102
|
provider: provider,
|
95
103
|
aws_access_key_id: aws_access_key_id,
|
@@ -101,6 +109,7 @@ module Vapi
|
|
101
109
|
org_id: org_id,
|
102
110
|
created_at: created_at,
|
103
111
|
updated_at: updated_at,
|
112
|
+
name: name,
|
104
113
|
additional_properties: struct
|
105
114
|
)
|
106
115
|
end
|
@@ -129,6 +138,7 @@ module Vapi
|
|
129
138
|
obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
|
130
139
|
obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
131
140
|
obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
141
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
132
142
|
end
|
133
143
|
end
|
134
144
|
end
|
@@ -15,6 +15,9 @@ module Vapi
|
|
15
15
|
# server. Will be sent as a header called x-vapi-secret.
|
16
16
|
# Same precedence logic as server.
|
17
17
|
attr_reader :secret
|
18
|
+
# @return [Hash{String => Object}] These are the custom headers to include in the request sent to your server.
|
19
|
+
# Each key-value pair represents a header name and its value.
|
20
|
+
attr_reader :headers
|
18
21
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
19
22
|
attr_reader :additional_properties
|
20
23
|
# @return [Object]
|
@@ -30,14 +33,22 @@ module Vapi
|
|
30
33
|
# @param secret [String] This is the secret you can set that Vapi will send with every request to your
|
31
34
|
# server. Will be sent as a header called x-vapi-secret.
|
32
35
|
# Same precedence logic as server.
|
36
|
+
# @param headers [Hash{String => Object}] These are the custom headers to include in the request sent to your server.
|
37
|
+
# Each key-value pair represents a header name and its value.
|
33
38
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
34
39
|
# @return [Vapi::Server]
|
35
|
-
def initialize(url:, timeout_seconds: OMIT, secret: OMIT, additional_properties: nil)
|
40
|
+
def initialize(url:, timeout_seconds: OMIT, secret: OMIT, headers: OMIT, additional_properties: nil)
|
36
41
|
@timeout_seconds = timeout_seconds if timeout_seconds != OMIT
|
37
42
|
@url = url
|
38
43
|
@secret = secret if secret != OMIT
|
44
|
+
@headers = headers if headers != OMIT
|
39
45
|
@additional_properties = additional_properties
|
40
|
-
@_field_set = {
|
46
|
+
@_field_set = {
|
47
|
+
"timeoutSeconds": timeout_seconds,
|
48
|
+
"url": url,
|
49
|
+
"secret": secret,
|
50
|
+
"headers": headers
|
51
|
+
}.reject do |_k, v|
|
41
52
|
v == OMIT
|
42
53
|
end
|
43
54
|
end
|
@@ -52,10 +63,12 @@ module Vapi
|
|
52
63
|
timeout_seconds = parsed_json["timeoutSeconds"]
|
53
64
|
url = parsed_json["url"]
|
54
65
|
secret = parsed_json["secret"]
|
66
|
+
headers = parsed_json["headers"]
|
55
67
|
new(
|
56
68
|
timeout_seconds: timeout_seconds,
|
57
69
|
url: url,
|
58
70
|
secret: secret,
|
71
|
+
headers: headers,
|
59
72
|
additional_properties: struct
|
60
73
|
)
|
61
74
|
end
|
@@ -77,6 +90,7 @@ module Vapi
|
|
77
90
|
obj.timeout_seconds&.is_a?(Float) != false || raise("Passed value for field obj.timeout_seconds is not the expected type, validation failed.")
|
78
91
|
obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
|
79
92
|
obj.secret&.is_a?(String) != false || raise("Passed value for field obj.secret is not the expected type, validation failed.")
|
93
|
+
obj.headers&.is_a?(Hash) != false || raise("Passed value for field obj.headers is not the expected type, validation failed.")
|
80
94
|
end
|
81
95
|
end
|
82
96
|
end
|
@@ -4,32 +4,24 @@ module Vapi
|
|
4
4
|
# This is the reason the call ended. This can also be found at `call.endedReason`
|
5
5
|
# on GET /call/:id.
|
6
6
|
class ServerMessageEndOfCallReportEndedReason
|
7
|
-
ASSISTANT_ERROR = "assistant-error"
|
8
|
-
ASSISTANT_NOT_FOUND = "assistant-not-found"
|
9
|
-
DB_ERROR = "db-error"
|
10
|
-
NO_SERVER_AVAILABLE = "no-server-available"
|
11
|
-
LICENSE_CHECK_FAILED = "license-check-failed"
|
12
|
-
PIPELINE_ERROR_OPENAI_LLM_FAILED = "pipeline-error-openai-llm-failed"
|
13
|
-
PIPELINE_ERROR_AZURE_OPENAI_LLM_FAILED = "pipeline-error-azure-openai-llm-failed"
|
14
|
-
PIPELINE_ERROR_GROQ_LLM_FAILED = "pipeline-error-groq-llm-failed"
|
15
|
-
PIPELINE_ERROR_ANTHROPIC_LLM_FAILED = "pipeline-error-anthropic-llm-failed"
|
16
|
-
PIPELINE_ERROR_VAPI_LLM_FAILED = "pipeline-error-vapi-llm-failed"
|
17
|
-
PIPELINE_ERROR_VAPI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-vapi-400-bad-request-validation-failed"
|
18
|
-
PIPELINE_ERROR_VAPI_401_UNAUTHORIZED = "pipeline-error-vapi-401-unauthorized"
|
19
|
-
PIPELINE_ERROR_VAPI_403_MODEL_ACCESS_DENIED = "pipeline-error-vapi-403-model-access-denied"
|
20
|
-
PIPELINE_ERROR_VAPI_429_EXCEEDED_QUOTA = "pipeline-error-vapi-429-exceeded-quota"
|
21
|
-
PIPELINE_ERROR_VAPI_500_SERVER_ERROR = "pipeline-error-vapi-500-server-error"
|
22
7
|
PIPELINE_ERROR_OPENAI_VOICE_FAILED = "pipeline-error-openai-voice-failed"
|
23
8
|
PIPELINE_ERROR_CARTESIA_VOICE_FAILED = "pipeline-error-cartesia-voice-failed"
|
24
|
-
PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED = "pipeline-error-deepgram-transcriber-failed"
|
25
9
|
PIPELINE_ERROR_DEEPGRAM_VOICE_FAILED = "pipeline-error-deepgram-voice-failed"
|
26
|
-
PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED = "pipeline-error-gladia-transcriber-failed"
|
27
10
|
PIPELINE_ERROR_ELEVEN_LABS_VOICE_FAILED = "pipeline-error-eleven-labs-voice-failed"
|
28
11
|
PIPELINE_ERROR_PLAYHT_VOICE_FAILED = "pipeline-error-playht-voice-failed"
|
29
12
|
PIPELINE_ERROR_LMNT_VOICE_FAILED = "pipeline-error-lmnt-voice-failed"
|
30
13
|
PIPELINE_ERROR_AZURE_VOICE_FAILED = "pipeline-error-azure-voice-failed"
|
31
14
|
PIPELINE_ERROR_RIME_AI_VOICE_FAILED = "pipeline-error-rime-ai-voice-failed"
|
32
15
|
PIPELINE_ERROR_NEETS_VOICE_FAILED = "pipeline-error-neets-voice-failed"
|
16
|
+
DB_ERROR = "db-error"
|
17
|
+
ASSISTANT_NOT_FOUND = "assistant-not-found"
|
18
|
+
LICENSE_CHECK_FAILED = "license-check-failed"
|
19
|
+
PIPELINE_ERROR_VAPI_LLM_FAILED = "pipeline-error-vapi-llm-failed"
|
20
|
+
PIPELINE_ERROR_VAPI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-vapi-400-bad-request-validation-failed"
|
21
|
+
PIPELINE_ERROR_VAPI_401_UNAUTHORIZED = "pipeline-error-vapi-401-unauthorized"
|
22
|
+
PIPELINE_ERROR_VAPI_403_MODEL_ACCESS_DENIED = "pipeline-error-vapi-403-model-access-denied"
|
23
|
+
PIPELINE_ERROR_VAPI_429_EXCEEDED_QUOTA = "pipeline-error-vapi-429-exceeded-quota"
|
24
|
+
PIPELINE_ERROR_VAPI_500_SERVER_ERROR = "pipeline-error-vapi-500-server-error"
|
33
25
|
PIPELINE_NO_AVAILABLE_MODEL = "pipeline-no-available-model"
|
34
26
|
WORKER_SHUTDOWN = "worker-shutdown"
|
35
27
|
UNKNOWN_ERROR = "unknown-error"
|
@@ -42,6 +34,16 @@ module Vapi
|
|
42
34
|
VAPIFAULT_TRANSPORT_NEVER_CONNECTED = "vapifault-transport-never-connected"
|
43
35
|
VAPIFAULT_WEB_CALL_WORKER_SETUP_FAILED = "vapifault-web-call-worker-setup-failed"
|
44
36
|
VAPIFAULT_TRANSPORT_CONNECTED_BUT_CALL_NOT_ACTIVE = "vapifault-transport-connected-but-call-not-active"
|
37
|
+
VAPIFAULT_CALL_STARTED_BUT_CONNECTION_TO_TRANSPORT_MISSING = "vapifault-call-started-but-connection-to-transport-missing"
|
38
|
+
PIPELINE_ERROR_DEEPGRAM_TRANSCRIBER_FAILED = "pipeline-error-deepgram-transcriber-failed"
|
39
|
+
PIPELINE_ERROR_GLADIA_TRANSCRIBER_FAILED = "pipeline-error-gladia-transcriber-failed"
|
40
|
+
PIPELINE_ERROR_ASSEMBLY_AI_TRANSCRIBER_FAILED = "pipeline-error-assembly-ai-transcriber-failed"
|
41
|
+
PIPELINE_ERROR_OPENAI_LLM_FAILED = "pipeline-error-openai-llm-failed"
|
42
|
+
PIPELINE_ERROR_AZURE_OPENAI_LLM_FAILED = "pipeline-error-azure-openai-llm-failed"
|
43
|
+
PIPELINE_ERROR_GROQ_LLM_FAILED = "pipeline-error-groq-llm-failed"
|
44
|
+
PIPELINE_ERROR_GOOGLE_LLM_FAILED = "pipeline-error-google-llm-failed"
|
45
|
+
PIPELINE_ERROR_XAI_LLM_FAILED = "pipeline-error-xai-llm-failed"
|
46
|
+
PIPELINE_ERROR_INFLECTION_AI_LLM_FAILED = "pipeline-error-inflection-ai-llm-failed"
|
45
47
|
ASSISTANT_NOT_INVALID = "assistant-not-invalid"
|
46
48
|
ASSISTANT_NOT_PROVIDED = "assistant-not-provided"
|
47
49
|
CALL_START_ERROR_NEITHER_ASSISTANT_NOR_SERVER_SET = "call-start-error-neither-assistant-nor-server-set"
|
@@ -68,6 +70,21 @@ module Vapi
|
|
68
70
|
PIPELINE_ERROR_OPENAI_403_MODEL_ACCESS_DENIED = "pipeline-error-openai-403-model-access-denied"
|
69
71
|
PIPELINE_ERROR_OPENAI_429_EXCEEDED_QUOTA = "pipeline-error-openai-429-exceeded-quota"
|
70
72
|
PIPELINE_ERROR_OPENAI_500_SERVER_ERROR = "pipeline-error-openai-500-server-error"
|
73
|
+
PIPELINE_ERROR_GOOGLE_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-google-400-bad-request-validation-failed"
|
74
|
+
PIPELINE_ERROR_GOOGLE_401_UNAUTHORIZED = "pipeline-error-google-401-unauthorized"
|
75
|
+
PIPELINE_ERROR_GOOGLE_403_MODEL_ACCESS_DENIED = "pipeline-error-google-403-model-access-denied"
|
76
|
+
PIPELINE_ERROR_GOOGLE_429_EXCEEDED_QUOTA = "pipeline-error-google-429-exceeded-quota"
|
77
|
+
PIPELINE_ERROR_GOOGLE_500_SERVER_ERROR = "pipeline-error-google-500-server-error"
|
78
|
+
PIPELINE_ERROR_XAI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-xai-400-bad-request-validation-failed"
|
79
|
+
PIPELINE_ERROR_XAI_401_UNAUTHORIZED = "pipeline-error-xai-401-unauthorized"
|
80
|
+
PIPELINE_ERROR_XAI_403_MODEL_ACCESS_DENIED = "pipeline-error-xai-403-model-access-denied"
|
81
|
+
PIPELINE_ERROR_XAI_429_EXCEEDED_QUOTA = "pipeline-error-xai-429-exceeded-quota"
|
82
|
+
PIPELINE_ERROR_XAI_500_SERVER_ERROR = "pipeline-error-xai-500-server-error"
|
83
|
+
PIPELINE_ERROR_INFLECTION_AI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-inflection-ai-400-bad-request-validation-failed"
|
84
|
+
PIPELINE_ERROR_INFLECTION_AI_401_UNAUTHORIZED = "pipeline-error-inflection-ai-401-unauthorized"
|
85
|
+
PIPELINE_ERROR_INFLECTION_AI_403_MODEL_ACCESS_DENIED = "pipeline-error-inflection-ai-403-model-access-denied"
|
86
|
+
PIPELINE_ERROR_INFLECTION_AI_429_EXCEEDED_QUOTA = "pipeline-error-inflection-ai-429-exceeded-quota"
|
87
|
+
PIPELINE_ERROR_INFLECTION_AI_500_SERVER_ERROR = "pipeline-error-inflection-ai-500-server-error"
|
71
88
|
PIPELINE_ERROR_AZURE_OPENAI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-azure-openai-400-bad-request-validation-failed"
|
72
89
|
PIPELINE_ERROR_AZURE_OPENAI_401_UNAUTHORIZED = "pipeline-error-azure-openai-401-unauthorized"
|
73
90
|
PIPELINE_ERROR_AZURE_OPENAI_403_MODEL_ACCESS_DENIED = "pipeline-error-azure-openai-403-model-access-denied"
|
@@ -83,6 +100,7 @@ module Vapi
|
|
83
100
|
PIPELINE_ERROR_ANTHROPIC_403_MODEL_ACCESS_DENIED = "pipeline-error-anthropic-403-model-access-denied"
|
84
101
|
PIPELINE_ERROR_ANTHROPIC_429_EXCEEDED_QUOTA = "pipeline-error-anthropic-429-exceeded-quota"
|
85
102
|
PIPELINE_ERROR_ANTHROPIC_500_SERVER_ERROR = "pipeline-error-anthropic-500-server-error"
|
103
|
+
PIPELINE_ERROR_ANTHROPIC_LLM_FAILED = "pipeline-error-anthropic-llm-failed"
|
86
104
|
PIPELINE_ERROR_TOGETHER_AI_400_BAD_REQUEST_VALIDATION_FAILED = "pipeline-error-together-ai-400-bad-request-validation-failed"
|
87
105
|
PIPELINE_ERROR_TOGETHER_AI_401_UNAUTHORIZED = "pipeline-error-together-ai-401-unauthorized"
|
88
106
|
PIPELINE_ERROR_TOGETHER_AI_403_MODEL_ACCESS_DENIED = "pipeline-error-together-ai-403-model-access-denied"
|
@@ -125,12 +143,12 @@ module Vapi
|
|
125
143
|
PIPELINE_ERROR_CUSTOM_LLM_429_EXCEEDED_QUOTA = "pipeline-error-custom-llm-429-exceeded-quota"
|
126
144
|
PIPELINE_ERROR_CUSTOM_LLM_500_SERVER_ERROR = "pipeline-error-custom-llm-500-server-error"
|
127
145
|
PIPELINE_ERROR_CUSTOM_LLM_LLM_FAILED = "pipeline-error-custom-llm-llm-failed"
|
146
|
+
PIPELINE_ERROR_CUSTOM_VOICE_FAILED = "pipeline-error-custom-voice-failed"
|
128
147
|
PIPELINE_ERROR_CARTESIA_SOCKET_HANG_UP = "pipeline-error-cartesia-socket-hang-up"
|
129
148
|
PIPELINE_ERROR_CARTESIA_REQUESTED_PAYMENT = "pipeline-error-cartesia-requested-payment"
|
130
149
|
PIPELINE_ERROR_CARTESIA_500_SERVER_ERROR = "pipeline-error-cartesia-500-server-error"
|
131
150
|
PIPELINE_ERROR_CARTESIA_503_SERVER_ERROR = "pipeline-error-cartesia-503-server-error"
|
132
151
|
PIPELINE_ERROR_CARTESIA_522_SERVER_ERROR = "pipeline-error-cartesia-522-server-error"
|
133
|
-
PIPELINE_ERROR_CUSTOM_VOICE_FAILED = "pipeline-error-custom-voice-failed"
|
134
152
|
PIPELINE_ERROR_ELEVEN_LABS_VOICE_NOT_FOUND = "pipeline-error-eleven-labs-voice-not-found"
|
135
153
|
PIPELINE_ERROR_ELEVEN_LABS_QUOTA_EXCEEDED = "pipeline-error-eleven-labs-quota-exceeded"
|
136
154
|
PIPELINE_ERROR_ELEVEN_LABS_UNAUTHORIZED_ACCESS = "pipeline-error-eleven-labs-unauthorized-access"
|
@@ -151,10 +169,12 @@ module Vapi
|
|
151
169
|
PIPELINE_ERROR_ELEVEN_LABS_VOICE_NOT_ALLOWED_FOR_FREE_USERS = "pipeline-error-eleven-labs-voice-not-allowed-for-free-users"
|
152
170
|
PIPELINE_ERROR_ELEVEN_LABS_500_SERVER_ERROR = "pipeline-error-eleven-labs-500-server-error"
|
153
171
|
PIPELINE_ERROR_ELEVEN_LABS_MAX_CHARACTER_LIMIT_EXCEEDED = "pipeline-error-eleven-labs-max-character-limit-exceeded"
|
172
|
+
PIPELINE_ERROR_ELEVEN_LABS_BLOCKED_VOICE_POTENTIALLY_AGAINST_TERMS_OF_SERVICE_AND_AWAITING_VERIFICATION = "pipeline-error-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification"
|
154
173
|
PIPELINE_ERROR_PLAYHT_REQUEST_TIMED_OUT = "pipeline-error-playht-request-timed-out"
|
155
174
|
PIPELINE_ERROR_PLAYHT_INVALID_VOICE = "pipeline-error-playht-invalid-voice"
|
156
175
|
PIPELINE_ERROR_PLAYHT_UNEXPECTED_ERROR = "pipeline-error-playht-unexpected-error"
|
157
176
|
PIPELINE_ERROR_PLAYHT_OUT_OF_CREDITS = "pipeline-error-playht-out-of-credits"
|
177
|
+
PIPELINE_ERROR_PLAYHT_INVALID_EMOTION = "pipeline-error-playht-invalid-emotion"
|
158
178
|
PIPELINE_ERROR_PLAYHT_VOICE_MUST_BE_A_VALID_VOICE_MANIFEST_URI = "pipeline-error-playht-voice-must-be-a-valid-voice-manifest-uri"
|
159
179
|
PIPELINE_ERROR_PLAYHT_401_UNAUTHORIZED = "pipeline-error-playht-401-unauthorized"
|
160
180
|
PIPELINE_ERROR_PLAYHT_403_FORBIDDEN_OUT_OF_CHARACTERS = "pipeline-error-playht-403-forbidden-out-of-characters"
|
@@ -162,15 +182,20 @@ module Vapi
|
|
162
182
|
PIPELINE_ERROR_PLAYHT_429_EXCEEDED_QUOTA = "pipeline-error-playht-429-exceeded-quota"
|
163
183
|
PIPELINE_ERROR_PLAYHT_502_GATEWAY_ERROR = "pipeline-error-playht-502-gateway-error"
|
164
184
|
PIPELINE_ERROR_PLAYHT_504_GATEWAY_ERROR = "pipeline-error-playht-504-gateway-error"
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
185
|
+
PIPELINE_ERROR_DEEPGRAM_RETURNING_403_MODEL_ACCESS_DENIED = "pipeline-error-deepgram-returning-403-model-access-denied"
|
186
|
+
PIPELINE_ERROR_DEEPGRAM_RETURNING_401_INVALID_CREDENTIALS = "pipeline-error-deepgram-returning-401-invalid-credentials"
|
187
|
+
PIPELINE_ERROR_DEEPGRAM_RETURNING_404_NOT_FOUND = "pipeline-error-deepgram-returning-404-not-found"
|
188
|
+
PIPELINE_ERROR_DEEPGRAM_RETURNING_400_NO_SUCH_MODEL_LANGUAGE_TIER_COMBINATION = "pipeline-error-deepgram-returning-400-no-such-model-language-tier-combination"
|
189
|
+
PIPELINE_ERROR_DEEPGRAM_RETURNING_500_INVALID_JSON = "pipeline-error-deepgram-returning-500-invalid-json"
|
190
|
+
PIPELINE_ERROR_DEEPGRAM_RETURNING_502_NETWORK_ERROR = "pipeline-error-deepgram-returning-502-network-error"
|
191
|
+
PIPELINE_ERROR_DEEPGRAM_RETURNING_502_BAD_GATEWAY_EHOSTUNREACH = "pipeline-error-deepgram-returning-502-bad-gateway-ehostunreach"
|
192
|
+
PIPELINE_ERROR_TAVUS_VIDEO_FAILED = "pipeline-error-tavus-video-failed"
|
193
|
+
PIPELINE_ERROR_CUSTOM_TRANSCRIBER_FAILED = "pipeline-error-custom-transcriber-failed"
|
170
194
|
SILENCE_TIMED_OUT = "silence-timed-out"
|
195
|
+
SIP_GATEWAY_FAILED_TO_CONNECT_CALL = "sip-gateway-failed-to-connect-call"
|
171
196
|
TWILIO_FAILED_TO_CONNECT_CALL = "twilio-failed-to-connect-call"
|
172
197
|
TWILIO_REPORTED_CUSTOMER_MISDIALED = "twilio-reported-customer-misdialed"
|
173
|
-
VOICEMAIL = "voicemail"
|
174
198
|
VONAGE_REJECTED = "vonage-rejected"
|
199
|
+
VOICEMAIL = "voicemail"
|
175
200
|
end
|
176
201
|
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "server_message_knowledge_base_request_phone_number"
|
4
|
+
require_relative "server_message_knowledge_base_request_messages_item"
|
5
|
+
require_relative "open_ai_message"
|
6
|
+
require_relative "artifact"
|
7
|
+
require_relative "create_assistant_dto"
|
8
|
+
require_relative "create_customer_dto"
|
9
|
+
require_relative "call"
|
10
|
+
require "ostruct"
|
11
|
+
require "json"
|
12
|
+
|
13
|
+
module Vapi
|
14
|
+
class ServerMessageKnowledgeBaseRequest
|
15
|
+
# @return [Vapi::ServerMessageKnowledgeBaseRequestPhoneNumber] This is the phone number associated with the call.
|
16
|
+
# This matches one of the following:
|
17
|
+
# - `call.phoneNumber`,
|
18
|
+
# - `call.phoneNumberId`.
|
19
|
+
attr_reader :phone_number
|
20
|
+
# @return [Array<Vapi::ServerMessageKnowledgeBaseRequestMessagesItem>] These are the messages that are going to be sent to the `model` right after the
|
21
|
+
# `knowledge-base-request` webhook completes.
|
22
|
+
attr_reader :messages
|
23
|
+
# @return [Array<Vapi::OpenAiMessage>] This is just `messages` formatted for OpenAI.
|
24
|
+
attr_reader :messages_open_ai_formatted
|
25
|
+
# @return [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
26
|
+
attr_reader :timestamp
|
27
|
+
# @return [Vapi::Artifact] This is a live version of the `call.artifact`.
|
28
|
+
# This matches what is stored on `call.artifact` after the call.
|
29
|
+
attr_reader :artifact
|
30
|
+
# @return [Vapi::CreateAssistantDto] This is the assistant that is currently active. This is provided for
|
31
|
+
# convenience.
|
32
|
+
# This matches one of the following:
|
33
|
+
# - `call.assistant`,
|
34
|
+
# - `call.assistantId`,
|
35
|
+
# - `call.squad[n].assistant`,
|
36
|
+
# - `call.squad[n].assistantId`,
|
37
|
+
# - `call.squadId->[n].assistant`,
|
38
|
+
# - `call.squadId->[n].assistantId`.
|
39
|
+
attr_reader :assistant
|
40
|
+
# @return [Vapi::CreateCustomerDto] This is the customer associated with the call.
|
41
|
+
# This matches one of the following:
|
42
|
+
# - `call.customer`,
|
43
|
+
# - `call.customerId`.
|
44
|
+
attr_reader :customer
|
45
|
+
# @return [Vapi::Call] This is the call object.
|
46
|
+
# This matches what was returned in POST /call.
|
47
|
+
# Note: This might get stale during the call. To get the latest call object,
|
48
|
+
# especially after the call is ended, use GET /call/:id.
|
49
|
+
attr_reader :call
|
50
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
51
|
+
attr_reader :additional_properties
|
52
|
+
# @return [Object]
|
53
|
+
attr_reader :_field_set
|
54
|
+
protected :_field_set
|
55
|
+
|
56
|
+
OMIT = Object.new
|
57
|
+
|
58
|
+
# @param phone_number [Vapi::ServerMessageKnowledgeBaseRequestPhoneNumber] This is the phone number associated with the call.
|
59
|
+
# This matches one of the following:
|
60
|
+
# - `call.phoneNumber`,
|
61
|
+
# - `call.phoneNumberId`.
|
62
|
+
# @param messages [Array<Vapi::ServerMessageKnowledgeBaseRequestMessagesItem>] These are the messages that are going to be sent to the `model` right after the
|
63
|
+
# `knowledge-base-request` webhook completes.
|
64
|
+
# @param messages_open_ai_formatted [Array<Vapi::OpenAiMessage>] This is just `messages` formatted for OpenAI.
|
65
|
+
# @param timestamp [String] This is the ISO-8601 formatted timestamp of when the message was sent.
|
66
|
+
# @param artifact [Vapi::Artifact] This is a live version of the `call.artifact`.
|
67
|
+
# This matches what is stored on `call.artifact` after the call.
|
68
|
+
# @param assistant [Vapi::CreateAssistantDto] This is the assistant that is currently active. This is provided for
|
69
|
+
# convenience.
|
70
|
+
# This matches one of the following:
|
71
|
+
# - `call.assistant`,
|
72
|
+
# - `call.assistantId`,
|
73
|
+
# - `call.squad[n].assistant`,
|
74
|
+
# - `call.squad[n].assistantId`,
|
75
|
+
# - `call.squadId->[n].assistant`,
|
76
|
+
# - `call.squadId->[n].assistantId`.
|
77
|
+
# @param customer [Vapi::CreateCustomerDto] This is the customer associated with the call.
|
78
|
+
# This matches one of the following:
|
79
|
+
# - `call.customer`,
|
80
|
+
# - `call.customerId`.
|
81
|
+
# @param call [Vapi::Call] This is the call object.
|
82
|
+
# This matches what was returned in POST /call.
|
83
|
+
# Note: This might get stale during the call. To get the latest call object,
|
84
|
+
# especially after the call is ended, use GET /call/:id.
|
85
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
86
|
+
# @return [Vapi::ServerMessageKnowledgeBaseRequest]
|
87
|
+
def initialize(messages_open_ai_formatted:, phone_number: OMIT, messages: OMIT, timestamp: OMIT, artifact: OMIT,
|
88
|
+
assistant: OMIT, customer: OMIT, call: OMIT, additional_properties: nil)
|
89
|
+
@phone_number = phone_number if phone_number != OMIT
|
90
|
+
@messages = messages if messages != OMIT
|
91
|
+
@messages_open_ai_formatted = messages_open_ai_formatted
|
92
|
+
@timestamp = timestamp if timestamp != OMIT
|
93
|
+
@artifact = artifact if artifact != OMIT
|
94
|
+
@assistant = assistant if assistant != OMIT
|
95
|
+
@customer = customer if customer != OMIT
|
96
|
+
@call = call if call != OMIT
|
97
|
+
@additional_properties = additional_properties
|
98
|
+
@_field_set = {
|
99
|
+
"phoneNumber": phone_number,
|
100
|
+
"messages": messages,
|
101
|
+
"messagesOpenAIFormatted": messages_open_ai_formatted,
|
102
|
+
"timestamp": timestamp,
|
103
|
+
"artifact": artifact,
|
104
|
+
"assistant": assistant,
|
105
|
+
"customer": customer,
|
106
|
+
"call": call
|
107
|
+
}.reject do |_k, v|
|
108
|
+
v == OMIT
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# Deserialize a JSON object to an instance of ServerMessageKnowledgeBaseRequest
|
113
|
+
#
|
114
|
+
# @param json_object [String]
|
115
|
+
# @return [Vapi::ServerMessageKnowledgeBaseRequest]
|
116
|
+
def self.from_json(json_object:)
|
117
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
118
|
+
parsed_json = JSON.parse(json_object)
|
119
|
+
if parsed_json["phoneNumber"].nil?
|
120
|
+
phone_number = nil
|
121
|
+
else
|
122
|
+
phone_number = parsed_json["phoneNumber"].to_json
|
123
|
+
phone_number = Vapi::ServerMessageKnowledgeBaseRequestPhoneNumber.from_json(json_object: phone_number)
|
124
|
+
end
|
125
|
+
messages = parsed_json["messages"]&.map do |item|
|
126
|
+
item = item.to_json
|
127
|
+
Vapi::ServerMessageKnowledgeBaseRequestMessagesItem.from_json(json_object: item)
|
128
|
+
end
|
129
|
+
messages_open_ai_formatted = parsed_json["messagesOpenAIFormatted"]&.map do |item|
|
130
|
+
item = item.to_json
|
131
|
+
Vapi::OpenAiMessage.from_json(json_object: item)
|
132
|
+
end
|
133
|
+
timestamp = parsed_json["timestamp"]
|
134
|
+
if parsed_json["artifact"].nil?
|
135
|
+
artifact = nil
|
136
|
+
else
|
137
|
+
artifact = parsed_json["artifact"].to_json
|
138
|
+
artifact = Vapi::Artifact.from_json(json_object: artifact)
|
139
|
+
end
|
140
|
+
if parsed_json["assistant"].nil?
|
141
|
+
assistant = nil
|
142
|
+
else
|
143
|
+
assistant = parsed_json["assistant"].to_json
|
144
|
+
assistant = Vapi::CreateAssistantDto.from_json(json_object: assistant)
|
145
|
+
end
|
146
|
+
if parsed_json["customer"].nil?
|
147
|
+
customer = nil
|
148
|
+
else
|
149
|
+
customer = parsed_json["customer"].to_json
|
150
|
+
customer = Vapi::CreateCustomerDto.from_json(json_object: customer)
|
151
|
+
end
|
152
|
+
if parsed_json["call"].nil?
|
153
|
+
call = nil
|
154
|
+
else
|
155
|
+
call = parsed_json["call"].to_json
|
156
|
+
call = Vapi::Call.from_json(json_object: call)
|
157
|
+
end
|
158
|
+
new(
|
159
|
+
phone_number: phone_number,
|
160
|
+
messages: messages,
|
161
|
+
messages_open_ai_formatted: messages_open_ai_formatted,
|
162
|
+
timestamp: timestamp,
|
163
|
+
artifact: artifact,
|
164
|
+
assistant: assistant,
|
165
|
+
customer: customer,
|
166
|
+
call: call,
|
167
|
+
additional_properties: struct
|
168
|
+
)
|
169
|
+
end
|
170
|
+
|
171
|
+
# Serialize an instance of ServerMessageKnowledgeBaseRequest to a JSON object
|
172
|
+
#
|
173
|
+
# @return [String]
|
174
|
+
def to_json(*_args)
|
175
|
+
@_field_set&.to_json
|
176
|
+
end
|
177
|
+
|
178
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
179
|
+
# hash and check each fields type against the current object's property
|
180
|
+
# definitions.
|
181
|
+
#
|
182
|
+
# @param obj [Object]
|
183
|
+
# @return [Void]
|
184
|
+
def self.validate_raw(obj:)
|
185
|
+
obj.phone_number.nil? || Vapi::ServerMessageKnowledgeBaseRequestPhoneNumber.validate_raw(obj: obj.phone_number)
|
186
|
+
obj.messages&.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.")
|
187
|
+
obj.messages_open_ai_formatted.is_a?(Array) != false || raise("Passed value for field obj.messages_open_ai_formatted is not the expected type, validation failed.")
|
188
|
+
obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
189
|
+
obj.artifact.nil? || Vapi::Artifact.validate_raw(obj: obj.artifact)
|
190
|
+
obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant)
|
191
|
+
obj.customer.nil? || Vapi::CreateCustomerDto.validate_raw(obj: obj.customer)
|
192
|
+
obj.call.nil? || Vapi::Call.validate_raw(obj: obj.call)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "user_message"
|
5
|
+
require_relative "system_message"
|
6
|
+
require_relative "bot_message"
|
7
|
+
require_relative "tool_call_message"
|
8
|
+
require_relative "tool_call_result_message"
|
9
|
+
|
10
|
+
module Vapi
|
11
|
+
class ServerMessageKnowledgeBaseRequestMessagesItem
|
12
|
+
# Deserialize a JSON object to an instance of
|
13
|
+
# ServerMessageKnowledgeBaseRequestMessagesItem
|
14
|
+
#
|
15
|
+
# @param json_object [String]
|
16
|
+
# @return [Vapi::ServerMessageKnowledgeBaseRequestMessagesItem]
|
17
|
+
def self.from_json(json_object:)
|
18
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
19
|
+
begin
|
20
|
+
Vapi::UserMessage.validate_raw(obj: struct)
|
21
|
+
return Vapi::UserMessage.from_json(json_object: struct) unless struct.nil?
|
22
|
+
|
23
|
+
return nil
|
24
|
+
rescue StandardError
|
25
|
+
# noop
|
26
|
+
end
|
27
|
+
begin
|
28
|
+
Vapi::SystemMessage.validate_raw(obj: struct)
|
29
|
+
return Vapi::SystemMessage.from_json(json_object: struct) unless struct.nil?
|
30
|
+
|
31
|
+
return nil
|
32
|
+
rescue StandardError
|
33
|
+
# noop
|
34
|
+
end
|
35
|
+
begin
|
36
|
+
Vapi::BotMessage.validate_raw(obj: struct)
|
37
|
+
return Vapi::BotMessage.from_json(json_object: struct) unless struct.nil?
|
38
|
+
|
39
|
+
return nil
|
40
|
+
rescue StandardError
|
41
|
+
# noop
|
42
|
+
end
|
43
|
+
begin
|
44
|
+
Vapi::ToolCallMessage.validate_raw(obj: struct)
|
45
|
+
return Vapi::ToolCallMessage.from_json(json_object: struct) unless struct.nil?
|
46
|
+
|
47
|
+
return nil
|
48
|
+
rescue StandardError
|
49
|
+
# noop
|
50
|
+
end
|
51
|
+
begin
|
52
|
+
Vapi::ToolCallResultMessage.validate_raw(obj: struct)
|
53
|
+
return Vapi::ToolCallResultMessage.from_json(json_object: struct) unless struct.nil?
|
54
|
+
|
55
|
+
return nil
|
56
|
+
rescue StandardError
|
57
|
+
# noop
|
58
|
+
end
|
59
|
+
struct
|
60
|
+
end
|
61
|
+
|
62
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
63
|
+
# hash and check each fields type against the current object's property
|
64
|
+
# definitions.
|
65
|
+
#
|
66
|
+
# @param obj [Object]
|
67
|
+
# @return [Void]
|
68
|
+
def self.validate_raw(obj:)
|
69
|
+
begin
|
70
|
+
return Vapi::UserMessage.validate_raw(obj: obj)
|
71
|
+
rescue StandardError
|
72
|
+
# noop
|
73
|
+
end
|
74
|
+
begin
|
75
|
+
return Vapi::SystemMessage.validate_raw(obj: obj)
|
76
|
+
rescue StandardError
|
77
|
+
# noop
|
78
|
+
end
|
79
|
+
begin
|
80
|
+
return Vapi::BotMessage.validate_raw(obj: obj)
|
81
|
+
rescue StandardError
|
82
|
+
# noop
|
83
|
+
end
|
84
|
+
begin
|
85
|
+
return Vapi::ToolCallMessage.validate_raw(obj: obj)
|
86
|
+
rescue StandardError
|
87
|
+
# noop
|
88
|
+
end
|
89
|
+
begin
|
90
|
+
return Vapi::ToolCallResultMessage.validate_raw(obj: obj)
|
91
|
+
rescue StandardError
|
92
|
+
# noop
|
93
|
+
end
|
94
|
+
raise("Passed value matched no type within the union, validation failed.")
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|