Class: Twilio::REST::Assistants::V1::AssistantInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/assistants/v1/assistant.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, id: nil) ⇒ AssistantInstance

Initialize the AssistantInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Assistant resource.

  • sid (String)

    The SID of the Call resource to fetch.



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 737

def initialize(version, payload , id: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'customer_ai' => payload['customer_ai'],
        'id' => payload['id'],
        'model' => payload['model'],
        'name' => payload['name'],
        'owner' => payload['owner'],
        'url' => payload['url'],
        'personality_prompt' => payload['personality_prompt'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'knowledge' => payload['knowledge'],
        'tools' => payload['tools'],
    }

    # Context
    @instance_context = nil
    @params = { 'id' => id  || @properties['id']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Assistant resource.

Returns:



775
776
777
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 775

def 
    @properties['account_sid']
end

#assistants_knowledgeassistants_knowledge

Access the assistants_knowledge

Returns:



896
897
898
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 896

def assistants_knowledge
    context.assistants_knowledge
end

#assistants_toolsassistants_tools

Access the assistants_tools

Returns:



889
890
891
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 889

def assistants_tools
    context.assistants_tools
end

#contextAssistantContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



766
767
768
769
770
771
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 766

def context
    unless @instance_context
        @instance_context = AssistantContext.new(@version , @params['id'])
    end
    @instance_context
end

#customer_aiHash

Returns The Personalization and Perception Engine settings.

Returns:

  • (Hash)

    The Personalization and Perception Engine settings.



781
782
783
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 781

def customer_ai
    @properties['customer_ai']
end

#date_createdTime

Returns The date and time in GMT when the Assistant was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



823
824
825
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 823

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the Assistant was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



829
830
831
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 829

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the AssistantInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



848
849
850
851
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 848

def delete

    context.delete
end

#feedbacksfeedbacks

Access the feedbacks

Returns:



875
876
877
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 875

def feedbacks
    context.feedbacks
end

#fetchAssistantInstance

Fetch the AssistantInstance

Returns:



856
857
858
859
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 856

def fetch

    context.fetch
end

#idString

Returns The Assistant ID.

Returns:

  • (String)

    The Assistant ID.



787
788
789
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 787

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



909
910
911
912
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 909

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Assistants.V1.AssistantInstance #{values}>"
end

#knowledgeArray<AssistantsV1ServiceKnowledge>

Returns The list of knowledge sources associated with the assistant.

Returns:

  • (Array<AssistantsV1ServiceKnowledge>)

    The list of knowledge sources associated with the assistant.



835
836
837
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 835

def knowledge
    @properties['knowledge']
end

#messagesmessages

Access the messages

Returns:



882
883
884
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 882

def messages
    context.messages
end

#modelString

Returns The default model used by the assistant.

Returns:

  • (String)

    The default model used by the assistant.



793
794
795
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 793

def model
    @properties['model']
end

#nameString

Returns The name of the assistant.

Returns:

  • (String)

    The name of the assistant.



799
800
801
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 799

def name
    @properties['name']
end

#ownerString

Returns The owner/company of the assistant.

Returns:

  • (String)

    The owner/company of the assistant.



805
806
807
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 805

def owner
    @properties['owner']
end

#personality_promptString

Returns The personality prompt to be used for assistant.

Returns:

  • (String)

    The personality prompt to be used for assistant.



817
818
819
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 817

def personality_prompt
    @properties['personality_prompt']
end

#to_sObject

Provide a user friendly representation



902
903
904
905
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 902

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Assistants.V1.AssistantInstance #{values}>"
end

#toolsArray<AssistantsV1ServiceTool>

Returns The list of tools associated with the assistant.

Returns:

  • (Array<AssistantsV1ServiceTool>)

    The list of tools associated with the assistant.



841
842
843
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 841

def tools
    @properties['tools']
end

#update(assistants_v1_service_update_assistant_request: :unset) ⇒ AssistantInstance

Update the AssistantInstance

Parameters:

  • assistants_v1_service_update_assistant_request (AssistantsV1ServiceUpdateAssistantRequest) (defaults to: :unset)

Returns:



865
866
867
868
869
870
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 865

def update(assistants_v1_service_update_assistant_request: :unset
)

    context.update(
    )
end

#urlString

Returns The url of the assistant resource.

Returns:

  • (String)

    The url of the assistant resource.



811
812
813
# File 'lib/twilio-ruby/rest/assistants/v1/assistant.rb', line 811

def url
    @properties['url']
end