mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-26 05:27:40 +00:00
Given latest GPT 3.5 16k which is both better steered and supports functions we can now support rich bot integration. Clunky system message based steering is removed and instead we use the function framework provided by Open AI
29 lines
759 B
Ruby
29 lines
759 B
Ruby
# frozen_string_literal: true
|
|
|
|
DiscourseAi::AiBot::EntryPoint::BOTS.each do |id, bot_username|
|
|
# let's not create a bot user if it already exists
|
|
# seed seems to be messing with dates on the user
|
|
# causing it to look like these bots were created at the
|
|
# wrong time
|
|
if !User.exists?(id: id)
|
|
UserEmail.seed do |ue|
|
|
ue.id = id
|
|
ue.email = "no_email_#{bot_username}"
|
|
ue.primary = true
|
|
ue.user_id = id
|
|
end
|
|
|
|
User.seed do |u|
|
|
u.id = id
|
|
u.name = bot_username.titleize
|
|
u.username = UserNameSuggester.suggest(bot_username)
|
|
u.password = SecureRandom.hex
|
|
u.active = true
|
|
u.admin = true
|
|
u.moderator = true
|
|
u.approved = true
|
|
u.trust_level = TrustLevel[4]
|
|
end
|
|
end
|
|
end
|