Skip to content

Commit 5dd52da

Browse files
committed
Support default disabled personas
1 parent df1089c commit 5dd52da

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

db/fixtures/personas/603_ai_personas.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def from_setting(setting_name)
3333
persona.allowed_group_ids = [Group::AUTO_GROUPS[:trust_level_0]]
3434
end
3535

36-
persona.enabled = !summarization_personas.include?(persona_class)
36+
persona.enabled = persona_class.default_enabled
3737
persona.priority = true if persona_class == DiscourseAi::Personas::General
3838
end
3939

lib/personas/forum_researcher.rb

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
module DiscourseAi
44
module Personas
55
class ForumResearcher < Persona
6+
def self.default_enabled
7+
false
8+
end
9+
610
def tools
711
[Tools::Researcher]
812
end

lib/personas/persona.rb

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ module DiscourseAi
44
module Personas
55
class Persona
66
class << self
7+
def default_enabled
8+
true
9+
end
10+
711
def rag_conversation_chunks
812
10
913
end

lib/personas/short_summarizer.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
module DiscourseAi
44
module Personas
55
class ShortSummarizer < Persona
6+
def self.default_enabled
7+
false
8+
end
9+
610
def system_prompt
711
<<~PROMPT.strip
812
You are an advanced summarization bot. Analyze a given conversation and produce a concise,
@@ -23,7 +27,7 @@ def system_prompt
2327
<output>
2428
{"summary": "xx"}
2529
</output>
26-
30+
2731
Where "xx" is replaced by the summary.
2832
PROMPT
2933
end

lib/personas/summarizer.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
module DiscourseAi
44
module Personas
55
class Summarizer < Persona
6+
def self.default_enabled
7+
false
8+
end
9+
610
def system_prompt
711
<<~PROMPT.strip
812
You are an advanced summarization bot that generates concise, coherent summaries of provided text.
@@ -18,13 +22,13 @@ def system_prompt
1822
- Example: link to the 6th post by jane: [agreed with]({resource_url}/6)
1923
- Example: link to the 13th post by joe: [joe]({resource_url}/13)
2024
- When formatting usernames either use @USERNAME OR [USERNAME]({resource_url}/POST_NUMBER)
21-
25+
2226
Format your response as a JSON object with a single key named "summary", which has the summary as the value.
2327
Your output should be in the following format:
2428
<output>
2529
{"summary": "xx"}
2630
</output>
27-
31+
2832
Where "xx" is replaced by the summary.
2933
PROMPT
3034
end

0 commit comments

Comments
 (0)