Class: Ruboty::OpenAIChat::Actions::ShowProfile

Inherits:
Base
  • Object
show all
Defined in:
lib/ruboty/openai_chat/actions/show_profile.rb

Constant Summary

Constants inherited from Base

Base::NAMESPACE, Base::PROFILE_KEY

Instance Attribute Summary

Attributes inherited from Base

#message

Instance Method Summary collapse

Methods inherited from Base

#client, #initialize, #memory, #openai_model, #pretexts, #robot

Constructor Details

This class inherits a constructor from Ruboty::OpenAIChat::Actions::Base

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ruboty/openai_chat/actions/show_profile.rb', line 9

def call
  if (profile = memory.namespace(NAMESPACE)[PROFILE_KEY])
    message.reply(profile, code: true)
  else
    message.reply("No profile is set.")
  end
rescue StandardError => e
  message.reply(e.message, code: true)
  raise e if ENV["OPENAI_CHAT_DEBUG"]

  true
end