Setup JedAI local ENV
echo "JEDAI_DEVENV_NAME=adit-saxena" >> .env
touch tmp/restart.txt
sudo service tribe-sidekiq restart
Run websocket pub/sub subscription
while true; do bundle exec rails ai:stream_jedai_responses; sleep 2; done
Create JedAI chatbot
bundle exec rails ai:create_ai_chat_bots
or manually
organization = Organization.find_by_subdomain('intellum'); nil
bot ||= ChatBots::AiChatBot.new(key: "intellum-ai-bot-#{organization.id}", organization: organization, is_public: false, metadata: { name: "JedAI - Learning Profile", jedai_options: { model: "learnning_profile_and_plan" } })
bot.save
bot.avatar ||= Documents::Image.create(attachment: URI.open('https://vignette.wikia.nocookie.net/simpsons/images/6/64/LinguoInfo.png'))
Fix Organization subdomain
Organization.all.each { |o| o.update(exceed_account_domain: "exceed.adit-saxena.dev.intellum.com")}
Setup JedAI local ENV
echo "JEDAI_DEVENV_NAME=adit-saxena" >> .env
touch tmp/restart.txt
sudo service exceed-sidekiq restart
Fix issues running component tests
sudo su postgres
psql -c "ALTER USER ubuntu with superuser"
exit
Enable FF and labs
Account.all.each { |a|
a.enable_feature!('ai_el_profesor')
a.enable_feature!('ai_content_evaluators_beta')
a.enable_feature!('labs_module')
params = { features: Core::Labs::Records::LabsFeature.all.pluck(:code).map {|code| {code: code, enabled: true}} }
Core::Labs::Api.update_labs_features(account_id: a.id, updated_by: "SetupLabs", params: params)
}
Add the embed JS and button trigger by adding:
<%# Render Chatbot to build the learner profile %>
<% if !neeman? %>
<button data-tribechat-ai="true" data-tribechat-ai-model="learner_profile">CLICK ME</button>
<%= render "/shared/embed_tribe",
detail: {
tribeDomain: tribe_base_url,
isAiChat: true,
aiModel: "learner_profile",
exceedUserId: current_user&.id,
exceedUri: request&.base_url,
}
%>
<% end %>
in the file
app/views/profiles/show.html.erb
Account.find_each { |a| a.enable_feature!('labs') }
labs_features = Core::Labs::Records::LabsFeature.all
labs_features.each { |lf| lf.update!(is_coming_soon: false) }
Account.find_each { |a|
labs_features.each { |lf|
Core::Labs::Records::AccountsLabsFeature.where(labs_feature_id: lf.id, account_id: a.id).first ||
Core::Labs::Records::AccountsLabsFeature.create!(labs_feature_id: lf.id, account_id: a.id, updated_by: 'DevBox Setup')
}
}