post rebase fixes

This commit is contained in:
Rafael Silva 2025-05-16 15:42:42 -03:00
parent 4ad887c835
commit 74d47a97c6
6 changed files with 23 additions and 17 deletions

View File

@ -125,8 +125,6 @@ module DiscourseAi
response = bot.reply(context)
debugger
matching_concepts = JSON.parse(response[0][0]).dig("matching_concepts")
matching_concepts || []

View File

@ -152,10 +152,12 @@ module DiscourseAi
raw_context << partial
current_thinking << partial
end
elsif partial.is_a?(DiscourseAi::Completions::StructuredOutput)
update_blk.call(partial, nil, :structured_output)
else
update_blk.call(partial)
elsif update_blk.present?
if partial.is_a?(DiscourseAi::Completions::StructuredOutput)
update_blk.call(partial, nil, :structured_output)
else
update_blk.call(partial)
end
end
end
end

View File

@ -17,11 +17,8 @@ module DiscourseAi
:context_post_ids,
:feature_name,
:resource_url,
<<<<<<< HEAD
:cancel_manager
=======
:cancel_manager,
:inferred_concepts
>>>>>>> 44391e27 (FEATURE: Extend inferred concepts to include posts)
def initialize(
post: nil,
@ -39,11 +36,8 @@ module DiscourseAi
context_post_ids: nil,
feature_name: "bot",
resource_url: nil,
<<<<<<< HEAD
cancel_manager: nil
=======
cancel_manager: nil,
inferred_concepts: []
>>>>>>> 44391e27 (FEATURE: Extend inferred concepts to include posts)
)
@participants = participants
@user = user

View File

@ -3,6 +3,10 @@
module DiscourseAi
module Personas
class ConceptDeduplicator < Persona
def self.default_enabled
false
end
def system_prompt
<<~PROMPT.strip
You will be given a list of machine-generated tags.
@ -42,7 +46,7 @@ module DiscourseAi
end
def response_format
[{ key: "streamlined_tags", type: "array" }]
[{ "key" => "streamlined_tags", "type" => "array" }]
end
end
end

View File

@ -3,6 +3,10 @@
module DiscourseAi
module Personas
class ConceptFinder < Persona
def self.default_enabled
false
end
def system_prompt
existing_concepts = DiscourseAi::InferredConcepts::Manager.list_concepts(limit: 100)
existing_concepts_text = ""
@ -38,7 +42,7 @@ module DiscourseAi
end
def response_format
[{ key: "concepts", type: "array" }]
[{ "key" => "concepts", "type" => "array" }]
end
end
end

View File

@ -3,6 +3,10 @@
module DiscourseAi
module Personas
class ConceptMatcher < Persona
def self.default_enabled
false
end
def system_prompt
<<~PROMPT.strip
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 @@ module DiscourseAi
end
def response_format
[{ key: "matching_concepts", type: "array" }]
[{ "key" => "matching_concepts", "type" => "array" }]
end
end
end