Class: Vapi::AsyncAssistantsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/assistants/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ Vapi::AsyncAssistantsClient

Parameters:



489
490
491
# File 'lib/vapi_server_sdk/assistants/client.rb', line 489

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientVapi::AsyncRequestClient (readonly)



485
486
487
# File 'lib/vapi_server_sdk/assistants/client.rb', line 485

def request_client
  @request_client
end

Instance Method Details

#create(request:, request_options: nil) ⇒ Vapi::Assistant

Examples:

api = Vapi::Client.new(
  base_url: "https://api.example.com",
  environment: Vapi::Environment::DEFAULT,
  token: "YOUR_AUTH_TOKEN"
)
api.assistants.create(request: {  })

Parameters:

  • request (Hash)

    Request of type Vapi::CreateAssistantDto, as a Hash

    • :transcriber (Hash)

    • :model (Hash)

    • :voice (Hash)

    • :first_message_mode (Vapi::CreateAssistantDtoFirstMessageMode)

    • :hipaa_enabled (Boolean)

    • :client_messages (Array<Vapi::CreateAssistantDtoClientMessagesItem>)

    • :server_messages (Array<Vapi::CreateAssistantDtoServerMessagesItem>)

    • :silence_timeout_seconds (Float)

    • :max_duration_seconds (Float)

    • :background_sound (Vapi::CreateAssistantDtoBackgroundSound)

    • :backchanneling_enabled (Boolean)

    • :background_denoising_enabled (Boolean)

    • :model_output_in_messages_enabled (Boolean)

    • :transport_configurations (Array<Vapi::TransportConfigurationTwilio>)

    • :name (String)

    • :first_message (String)

    • :voicemail_detection (Hash)

      • :provider (String)

      • :voicemail_detection_types (Array<Vapi::TwilioVoicemailDetectionVoicemailDetectionTypesItem>)

      • :enabled (Boolean)

      • :machine_detection_timeout (Float)

      • :machine_detection_speech_threshold (Float)

      • :machine_detection_speech_end_threshold (Float)

      • :machine_detection_silence_timeout (Float)

    • :voicemail_message (String)

    • :end_call_message (String)

    • :end_call_phrases (Array<String>)

    • :metadata (Hash=> Object)

    • :server_url (String)

    • :server_url_secret (String)

    • :analysis_plan (Hash)

      • :summary_plan (Hash)

        • :messages (Array<Hash=> Object>)

        • :enabled (Boolean)

        • :timeout_seconds (Float)

      • :structured_data_plan (Hash)

        • :messages (Array<Hash=> Object>)

        • :enabled (Boolean)

        • :schema (Hash)

          • :type (Vapi::JsonSchemaType)

          • :items (Hash=> Object)

          • :properties (Hash=> Object)

          • :description (String)

          • :required (Array<String>)

        • :timeout_seconds (Float)

      • :success_evaluation_plan (Hash)

        • :rubric (Vapi::SuccessEvaluationPlanRubric)

        • :messages (Array<Hash=> Object>)

        • :enabled (Boolean)

        • :timeout_seconds (Float)

    • :artifact_plan (Hash)

      • :recording_enabled (Boolean)

      • :video_recording_enabled (Boolean)

      • :transcript_plan (Hash)

        • :enabled (Boolean)

        • :assistant_name (String)

        • :user_name (String)

      • :recording_path (String)

    • :message_plan (Hash)

      • :idle_messages (Array<String>)

      • :idle_message_max_spoken_count (Float)

      • :idle_timeout_seconds (Float)

    • :start_speaking_plan (Hash)

      • :wait_seconds (Float)

      • :smart_endpointing_enabled (Boolean)

      • :transcription_endpointing_plan (Hash)

        • :on_punctuation_seconds (Float)

        • :on_no_punctuation_seconds (Float)

        • :on_number_seconds (Float)

    • :stop_speaking_plan (Hash)

      • :num_words (Float)

      • :voice_seconds (Float)

      • :backoff_seconds (Float)

    • :monitor_plan (Hash)

      • :listen_enabled (Boolean)

      • :control_enabled (Boolean)

    • :credential_ids (Array<String>)

  • request_options (Vapi::RequestOptions) (defaults to: nil)

Returns:



638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/vapi_server_sdk/assistants/client.rb', line 638

def create(request:, request_options: nil)
  Async do
    response = @request_client.conn.post do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(request_options: request_options)}/assistant"
    end
    Vapi::Assistant.from_json(json_object: response.body)
  end
end

#delete(id:, request_options: nil) ⇒ Vapi::Assistant

Examples:

api = Vapi::Client.new(
  base_url: "https://api.example.com",
  environment: Vapi::Environment::DEFAULT,
  token: "YOUR_AUTH_TOKEN"
)
api.assistants.delete(id: "id")

Parameters:

Returns:



700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# File 'lib/vapi_server_sdk/assistants/client.rb', line 700

def delete(id:, request_options: nil)
  Async do
    response = @request_client.conn.delete do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      unless request_options.nil? || request_options&.additional_body_parameters.nil?
        req.body = { **(request_options&.additional_body_parameters || {}) }.compact
      end
      req.url "#{@request_client.get_url(request_options: request_options)}/assistant/#{id}"
    end
    Vapi::Assistant.from_json(json_object: response.body)
  end
end

#get(id:, request_options: nil) ⇒ Vapi::Assistant

Examples:

api = Vapi::Client.new(
  base_url: "https://api.example.com",
  environment: Vapi::Environment::DEFAULT,
  token: "YOUR_AUTH_TOKEN"
)
api.assistants.get(id: "id")

Parameters:

Returns:



668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
# File 'lib/vapi_server_sdk/assistants/client.rb', line 668

def get(id:, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      unless request_options.nil? || request_options&.additional_body_parameters.nil?
        req.body = { **(request_options&.additional_body_parameters || {}) }.compact
      end
      req.url "#{@request_client.get_url(request_options: request_options)}/assistant/#{id}"
    end
    Vapi::Assistant.from_json(json_object: response.body)
  end
end

#list(limit: nil, created_at_gt: nil, created_at_lt: nil, created_at_ge: nil, created_at_le: nil, updated_at_gt: nil, updated_at_lt: nil, updated_at_ge: nil, updated_at_le: nil, request_options: nil) ⇒ Array<Vapi::Assistant>

Examples:

api = Vapi::Client.new(
  base_url: "https://api.example.com",
  environment: Vapi::Environment::DEFAULT,
  token: "YOUR_AUTH_TOKEN"
)
api.assistants.list

Parameters:

  • limit (Float) (defaults to: nil)

    This is the maximum number of items to return. Defaults to 100.

  • created_at_gt (DateTime) (defaults to: nil)

    This will return items where the createdAt is greater than the specified value.

  • created_at_lt (DateTime) (defaults to: nil)

    This will return items where the createdAt is less than the specified value.

  • created_at_ge (DateTime) (defaults to: nil)

    This will return items where the createdAt is greater than or equal to the specified value.

  • created_at_le (DateTime) (defaults to: nil)

    This will return items where the createdAt is less than or equal to the specified value.

  • updated_at_gt (DateTime) (defaults to: nil)

    This will return items where the updatedAt is greater than the specified value.

  • updated_at_lt (DateTime) (defaults to: nil)

    This will return items where the updatedAt is less than the specified value.

  • updated_at_ge (DateTime) (defaults to: nil)

    This will return items where the updatedAt is greater than or equal to the specified value.

  • updated_at_le (DateTime) (defaults to: nil)

    This will return items where the updatedAt is less than or equal to the specified value.

  • request_options (Vapi::RequestOptions) (defaults to: nil)

Returns:



515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
# File 'lib/vapi_server_sdk/assistants/client.rb', line 515

def list(limit: nil, created_at_gt: nil, created_at_lt: nil, created_at_ge: nil, created_at_le: nil,
         updated_at_gt: nil, updated_at_lt: nil, updated_at_ge: nil, updated_at_le: nil, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.params = {
        **(request_options&.additional_query_parameters || {}),
        "limit": limit,
        "createdAtGt": created_at_gt,
        "createdAtLt": created_at_lt,
        "createdAtGe": created_at_ge,
        "createdAtLe": created_at_le,
        "updatedAtGt": updated_at_gt,
        "updatedAtLt": updated_at_lt,
        "updatedAtGe": updated_at_ge,
        "updatedAtLe": updated_at_le
      }.compact
      unless request_options.nil? || request_options&.additional_body_parameters.nil?
        req.body = { **(request_options&.additional_body_parameters || {}) }.compact
      end
      req.url "#{@request_client.get_url(request_options: request_options)}/assistant"
    end
    parsed_json = JSON.parse(response.body)
    parsed_json&.map do |item|
      item = item.to_json
      Vapi::Assistant.from_json(json_object: item)
    end
  end
end

#update(id:, transcriber: nil, model: nil, voice: nil, first_message_mode: nil, hipaa_enabled: nil, client_messages: nil, server_messages: nil, silence_timeout_seconds: nil, max_duration_seconds: nil, background_sound: nil, backchanneling_enabled: nil, background_denoising_enabled: nil, model_output_in_messages_enabled: nil, transport_configurations: nil, name: nil, first_message: nil, voicemail_detection: nil, voicemail_message: nil, end_call_message: nil, end_call_phrases: nil, metadata: nil, server_url: nil, server_url_secret: nil, analysis_plan: nil, artifact_plan: nil, message_plan: nil, start_speaking_plan: nil, stop_speaking_plan: nil, monitor_plan: nil, credential_ids: nil, request_options: nil) ⇒ Vapi::Assistant

Examples:

api = Vapi::Client.new(
  base_url: "https://api.example.com",
  environment: Vapi::Environment::DEFAULT,
  token: "YOUR_AUTH_TOKEN"
)
api.assistants.update(id: "id")

Parameters:

  • id (String)
  • transcriber (Vapi::Assistants::UpdateAssistantDtoTranscriber) (defaults to: nil)

    These are the options for the assistant’s transcriber.

  • model (Vapi::Assistants::UpdateAssistantDtoModel) (defaults to: nil)

    These are the options for the assistant’s LLM.

  • voice (Vapi::Assistants::UpdateAssistantDtoVoice) (defaults to: nil)

    These are the options for the assistant’s voice.

  • first_message_mode (Vapi::Assistants::UpdateAssistantDtoFirstMessageMode) (defaults to: nil)

    This is the mode for the first message. Default is ‘assistant-speaks-first’. Use:

    • ‘assistant-speaks-first’ to have the assistant speak first.

    • ‘assistant-waits-for-user’ to have the assistant wait for the user to speak

    first.

    • ‘assistant-speaks-first-with-model-generated-message’ to have the assistant

    speak first with a message generated by the model based on the conversation state. (‘assistant.model.messages` at call start, `call.messages` at squad transfer points). @default ’assistant-speaks-first’

  • hipaa_enabled (Boolean) (defaults to: nil)

    When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false.

  • client_messages (Array<Vapi::Assistants::UpdateAssistantDtoClientMessagesItem>) (defaults to: nil)

    These are the messages that will be sent to your Client SDKs. Default is ,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema.

  • server_messages (Array<Vapi::Assistants::UpdateAssistantDtoServerMessagesItem>) (defaults to: nil)

    These are the messages that will be sent to your Server URL. Default is h-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.

  • silence_timeout_seconds (Float) (defaults to: nil)

    How many seconds of silence to wait before ending the call. Defaults to 30. @default 30

  • max_duration_seconds (Float) (defaults to: nil)

    This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. @default 600 (10 minutes)

  • background_sound (Vapi::Assistants::UpdateAssistantDtoBackgroundSound) (defaults to: nil)

    This is the background sound in the call. Default for phone calls is ‘office’ and default for web calls is ‘off’.

  • backchanneling_enabled (Boolean) (defaults to: nil)

    This determines whether the model says ‘mhmm’, ‘ahem’ etc. while user is speaking. Default ‘false` while in beta. @default false

  • background_denoising_enabled (Boolean) (defaults to: nil)

    This enables filtering of noise and background speech while the user is talking. Default ‘false` while in beta. @default false

  • model_output_in_messages_enabled (Boolean) (defaults to: nil)

    This determines whether the model’s output is used in conversation history rather than the transcription of assistant’s speech. Default ‘false` while in beta. @default false

  • transport_configurations (Array<Hash>) (defaults to: nil)

    These are the configurations to be passed to the transport providers of assistant’s calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used.Request of type Array<Vapi::TransportConfigurationTwilio>, as a Hash

    * :provider (String)
    * :timeout (Float)
    * :record (Boolean)
    * :recording_channels (Vapi::TransportConfigurationTwilioRecordingChannels)
    
  • name (String) (defaults to: nil)

    This is the name of the assistant. This is required when you want to transfer between assistants in a call.

  • first_message (String) (defaults to: nil)

    This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). If unspecified, assistant will wait for user to speak and use the model to respond once they speak.

  • voicemail_detection (Hash) (defaults to: nil)

    These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=. This uses Twilio’s built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.Request of type Vapi::TwilioVoicemailDetection, as a Hash

    * :provider (String)
    * :voicemail_detection_types (Array<Vapi::TwilioVoicemailDetectionVoicemailDetectionTypesItem>)
    * :enabled (Boolean)
    * :machine_detection_timeout (Float)
    * :machine_detection_speech_threshold (Float)
    * :machine_detection_speech_end_threshold (Float)
    * :machine_detection_silence_timeout (Float)
    
  • voicemail_message (String) (defaults to: nil)

    This is the message that the assistant will say if the call is forwarded to voicemail. If unspecified, it will hang up.

  • end_call_message (String) (defaults to: nil)

    This is the message that the assistant will say if it ends the call. If unspecified, it will hang up without saying anything.

  • end_call_phrases (Array<String>) (defaults to: nil)

    This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.

  • metadata (Hash{String => Object}) (defaults to: nil)

    This is for metadata you want to store on the assistant.

  • server_url (String) (defaults to: nil)

    This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation. This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl

  • server_url_secret (String) (defaults to: nil)

    This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. Same precedence logic as serverUrl.

  • analysis_plan (Hash) (defaults to: nil)

    This is the plan for analysis of assistant’s calls. Stored in ‘call.analysis`.Request of type Vapi::AnalysisPlan, as a Hash

    • :summary_plan (Hash)

      • :messages (Array<Hash=> Object>)

      • :enabled (Boolean)

      • :timeout_seconds (Float)

    • :structured_data_plan (Hash)

      • :messages (Array<Hash=> Object>)

      • :enabled (Boolean)

      • :schema (Hash)

        • :type (Vapi::JsonSchemaType)

        • :items (Hash=> Object)

        • :properties (Hash=> Object)

        • :description (String)

        • :required (Array<String>)

      • :timeout_seconds (Float)

    • :success_evaluation_plan (Hash)

      • :rubric (Vapi::SuccessEvaluationPlanRubric)

      • :messages (Array<Hash=> Object>)

      • :enabled (Boolean)

      • :timeout_seconds (Float)

  • artifact_plan (Hash) (defaults to: nil)

    This is the plan for artifacts generated during assistant’s calls. Stored in ‘call.artifact`. Note: `recordingEnabled` is currently at the root level. It will be moved to `artifactPlan` in the future, but will remain backwards compatible.Request of type Vapi::ArtifactPlan, as a Hash

    * :recording_enabled (Boolean)
    * :video_recording_enabled (Boolean)
    * :transcript_plan (Hash)
      * :enabled (Boolean)
      * :assistant_name (String)
      * :user_name (String)
    * :recording_path (String)
    
  • message_plan (Hash) (defaults to: nil)

    This is the plan for static predefined messages that can be spoken by the assistant during the call, like ‘idleMessages`. Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible.Request of type Vapi::MessagePlan, as a Hash

    * :idle_messages (Array<String>)
    * :idle_message_max_spoken_count (Float)
    * :idle_timeout_seconds (Float)
    
  • start_speaking_plan (Hash) (defaults to: nil)

    This is the plan for when the assistant should start talking. You should configure this if you’re running into these issues:

    • The assistant is too slow to start talking after the customer is done

    speaking.

    • The assistant is too fast to start talking after the customer is done

    speaking.

    • The assistant is so fast that it’s actually interrupting the customer.Request of type Vapi::StartSpeakingPlan, as a Hash

    • :wait_seconds (Float)

    • :smart_endpointing_enabled (Boolean)

    • :transcription_endpointing_plan (Hash)

      • :on_punctuation_seconds (Float)

      • :on_no_punctuation_seconds (Float)

      • :on_number_seconds (Float)

  • stop_speaking_plan (Hash) (defaults to: nil)

    This is the plan for when assistant should stop talking on customer interruption. You should configure this if you’re running into these issues:

    • The assistant is too slow to recognize customer’s interruption.

    • The assistant is too fast to recognize customer’s interruption.

    • The assistant is getting interrupted by phrases that are just acknowledgments.

    • The assistant is getting interrupted by background noises.

    • The assistant is not properly stopping – it starts talking right after

    getting interrupted.Request of type Vapi::StopSpeakingPlan, as a Hash

    * :num_words (Float)
    * :voice_seconds (Float)
    * :backoff_seconds (Float)
    
  • monitor_plan (Hash) (defaults to: nil)

    This is the plan for real-time monitoring of the assistant’s calls. Usage:

    • To enable live listening of the assistant’s calls, set

    ‘monitorPlan.listenEnabled` to `true`.

    • To enable live control of the assistant’s calls, set

    ‘monitorPlan.controlEnabled` to `true`. Note, `serverMessages`, `clientMessages`, `serverUrl` and `serverUrlSecret` are currently at the root level but will be moved to `monitorPlan` in the future. Will remain backwards compatibleRequest of type Vapi::MonitorPlan, as a Hash

    * :listen_enabled (Boolean)
    * :control_enabled (Boolean)
    
  • credential_ids (Array<String>) (defaults to: nil)

    These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this.

  • request_options (Vapi::RequestOptions) (defaults to: nil)

Returns:



896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
# File 'lib/vapi_server_sdk/assistants/client.rb', line 896

def update(id:, transcriber: nil, model: nil, voice: nil, first_message_mode: nil, hipaa_enabled: nil,
           client_messages: nil, server_messages: nil, silence_timeout_seconds: nil, max_duration_seconds: nil, background_sound: nil, backchanneling_enabled: nil, background_denoising_enabled: nil, model_output_in_messages_enabled: nil, transport_configurations: nil, name: nil, first_message: nil, voicemail_detection: nil, voicemail_message: nil, end_call_message: nil, end_call_phrases: nil, metadata: nil, server_url: nil, server_url_secret: nil, analysis_plan: nil, artifact_plan: nil, message_plan: nil, start_speaking_plan: nil, stop_speaking_plan: nil, monitor_plan: nil, credential_ids: nil, request_options: nil)
  Async do
    response = @request_client.conn.patch do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      req.body = {
        **(request_options&.additional_body_parameters || {}),
        transcriber: transcriber,
        model: model,
        voice: voice,
        firstMessageMode: first_message_mode,
        hipaaEnabled: hipaa_enabled,
        clientMessages: client_messages,
        serverMessages: server_messages,
        silenceTimeoutSeconds: silence_timeout_seconds,
        maxDurationSeconds: max_duration_seconds,
        backgroundSound: background_sound,
        backchannelingEnabled: backchanneling_enabled,
        backgroundDenoisingEnabled: background_denoising_enabled,
        modelOutputInMessagesEnabled: model_output_in_messages_enabled,
        transportConfigurations: transport_configurations,
        name: name,
        firstMessage: first_message,
        voicemailDetection: voicemail_detection,
        voicemailMessage: voicemail_message,
        endCallMessage: end_call_message,
        endCallPhrases: end_call_phrases,
        metadata: ,
        serverUrl: server_url,
        serverUrlSecret: server_url_secret,
        analysisPlan: analysis_plan,
        artifactPlan: artifact_plan,
        messagePlan: message_plan,
        startSpeakingPlan: start_speaking_plan,
        stopSpeakingPlan: stop_speaking_plan,
        monitorPlan: monitor_plan,
        credentialIds: credential_ids
      }.compact
      req.url "#{@request_client.get_url(request_options: request_options)}/assistant/#{id}"
    end
    Vapi::Assistant.from_json(json_object: response.body)
  end
end