class Nylas::SmartCompose
Nylas
Smart Compose API
Public Instance Methods
compose_message(identifier:, request_body:)
click to toggle source
Compose a message.
@param identifier [String] Grant ID or email account to generate a message suggestion for. @param request_body [Hash] The prompt that smart compose will use to generate a message suggestion. @return [Array(Hash, String)] The generated message and API Request ID.
# File lib/nylas/resources/smart_compose.rb, line 16 def compose_message(identifier:, request_body:) post( path: "#{api_uri}/v3/grants/#{identifier}/messages/smart-compose", request_body: request_body ) end
compose_message_reply(identifier:, message_id:, request_body:)
click to toggle source
Compose a message reply.
@param identifier [String] Grant ID or email account to generate a message suggestion for. @param message_id [String] The id of the message to reply to. @param request_body [Hash] The prompt that smart compose will use to generate a message reply. @return [Array(Hash, String)] The generated message reply and API Request ID.
# File lib/nylas/resources/smart_compose.rb, line 29 def compose_message_reply(identifier:, message_id:, request_body:) post( path: "#{api_uri}/v3/grants/#{identifier}/messages/#{message_id}/smart-compose", request_body: request_body ) end