Skip to content

Commit 74d47a9

Browse files
committed
post rebase fixes
1 parent 4ad887c commit 74d47a9

File tree

6 files changed

+23
-17
lines changed

6 files changed

+23
-17
lines changed

lib/inferred_concepts/applier.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ def self.match_concepts_to_content(content, concept_list)
125125

126126
response = bot.reply(context)
127127

128-
debugger
129-
130128
matching_concepts = JSON.parse(response[0][0]).dig("matching_concepts")
131129

132130
matching_concepts || []

lib/personas/bot.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,12 @@ def reply(context, llm_args: {}, &update_blk)
152152
raw_context << partial
153153
current_thinking << partial
154154
end
155-
elsif partial.is_a?(DiscourseAi::Completions::StructuredOutput)
156-
update_blk.call(partial, nil, :structured_output)
157-
else
158-
update_blk.call(partial)
155+
elsif update_blk.present?
156+
if partial.is_a?(DiscourseAi::Completions::StructuredOutput)
157+
update_blk.call(partial, nil, :structured_output)
158+
else
159+
update_blk.call(partial)
160+
end
159161
end
160162
end
161163
end

lib/personas/bot_context.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ class BotContext
1717
:context_post_ids,
1818
:feature_name,
1919
:resource_url,
20-
<<<<<<< HEAD
21-
:cancel_manager
22-
=======
20+
:cancel_manager,
2321
:inferred_concepts
24-
>>>>>>> 44391e27 (FEATURE: Extend inferred concepts to include posts)
2522

2623
def initialize(
2724
post: nil,
@@ -39,11 +36,8 @@ def initialize(
3936
context_post_ids: nil,
4037
feature_name: "bot",
4138
resource_url: nil,
42-
<<<<<<< HEAD
43-
cancel_manager: nil
44-
=======
39+
cancel_manager: nil,
4540
inferred_concepts: []
46-
>>>>>>> 44391e27 (FEATURE: Extend inferred concepts to include posts)
4741
)
4842
@participants = participants
4943
@user = user

lib/personas/concept_deduplicator.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
module DiscourseAi
44
module Personas
55
class ConceptDeduplicator < Persona
6+
def self.default_enabled
7+
false
8+
end
9+
610
def system_prompt
711
<<~PROMPT.strip
812
You will be given a list of machine-generated tags.
@@ -42,7 +46,7 @@ def system_prompt
4246
end
4347

4448
def response_format
45-
[{ key: "streamlined_tags", type: "array" }]
49+
[{ "key" => "streamlined_tags", "type" => "array" }]
4650
end
4751
end
4852
end

lib/personas/concept_finder.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
module DiscourseAi
44
module Personas
55
class ConceptFinder < Persona
6+
def self.default_enabled
7+
false
8+
end
9+
610
def system_prompt
711
existing_concepts = DiscourseAi::InferredConcepts::Manager.list_concepts(limit: 100)
812
existing_concepts_text = ""
@@ -38,7 +42,7 @@ def system_prompt
3842
end
3943

4044
def response_format
41-
[{ key: "concepts", type: "array" }]
45+
[{ "key" => "concepts", "type" => "array" }]
4246
end
4347
end
4448
end

lib/personas/concept_matcher.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
module DiscourseAi
44
module Personas
55
class ConceptMatcher < Persona
6+
def self.default_enabled
7+
false
8+
end
9+
610
def system_prompt
711
<<~PROMPT.strip
812
You are an advanced concept matching system that determines which concepts from a provided list are relevant to a piece of content.
@@ -32,7 +36,7 @@ def system_prompt
3236
end
3337

3438
def response_format
35-
[{ key: "matching_concepts", type: "array" }]
39+
[{ "key" => "matching_concepts", "type" => "array" }]
3640
end
3741
end
3842
end

0 commit comments

Comments
 (0)