Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit c1fc3c7

Browse files
committed
cleanup
1 parent 2312a6f commit c1fc3c7

File tree

9 files changed

+18
-16
lines changed

9 files changed

+18
-16
lines changed

.claude/settings.local.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

app/controllers/discourse_ai/ai_bot/bot_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def discover
4949
ai_persona =
5050
AiPersona
5151
.all_personas(enabled_only: false)
52-
.find { |persona| persona.id == SiteSetting.ai_bot_discover_persona.to_i }
52+
.find { |p| p.id == SiteSetting.ai_bot_discover_persona.to_i }
5353

5454
if ai_persona.nil? || !current_user.in_any_groups?(ai_persona.allowed_group_ids.to_a)
5555
raise Discourse::InvalidAccess.new

app/jobs/regular/stream_discover_reply.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def execute(args)
1111
ai_persona_klass =
1212
AiPersona
1313
.all_personas(enabled_only: false)
14-
.find { |persona| persona.id == SiteSetting.ai_bot_discover_persona.to_i }
14+
.find { |p| p.id == SiteSetting.ai_bot_discover_persona.to_i }
1515

1616
if ai_persona_klass.nil? || !user.in_any_groups?(ai_persona_klass.allowed_group_ids.to_a)
1717
return

config/locales/server.en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ en:
336336
concept_matcher:
337337
name: "Concept Matcher"
338338
description: "AI Bot specialized in matching content against existing concepts"
339+
concept_deduplicator:
340+
name: "Concept Deduplicator"
341+
description: "AI Bot specialized in deduplicating concepts"
339342
topic_not_found: "Summary unavailable, topic not found!"
340343
summarizing: "Summarizing topic"
341344
searching: "Searching for: '%{query}'"

db/migrate/20250508183456_create_inferred_concepts_topics.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
class CreateInferredConceptsTopics < ActiveRecord::Migration[7.0]
44
def change
55
create_table :inferred_concepts_topics, id: false do |t|
6-
t.belongs_to :inferred_concept
7-
t.belongs_to :topic
6+
t.bigint :inferred_concept_id
7+
t.bigint :topic_id
88
t.timestamps
99
end
10+
11+
create_index :inferred_concepts_topics, %i[topic_id inferred_concept_id], unique: true
12+
create_index :inferred_concepts_topics, :inferred_concept_id
1013
end
1114
end

db/migrate/20250509000001_create_inferred_concepts_posts.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
class CreateInferredConceptsPosts < ActiveRecord::Migration[7.0]
44
def change
55
create_table :inferred_concepts_posts, id: false do |t|
6-
t.belongs_to :inferred_concept
7-
t.belongs_to :post
6+
t.bigint :inferred_concept_id
7+
t.bigint :post_id
88
t.timestamps
99
end
10+
11+
create_index :inferred_concepts_posts, %i[post_id inferred_concept_id], unique: true
12+
create_index :inferred_concepts_posts, :inferred_concept_id
1013
end
1114
end

lib/discord/bot/persona_replier.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def initialize(body)
77
@persona =
88
AiPersona
99
.all_personas(enabled_only: false)
10-
.find { |persona| persona.id == SiteSetting.ai_discord_search_persona.to_i }
10+
.find { |p| p.id == SiteSetting.ai_discord_search_persona.to_i }
1111
.new
1212
@bot =
1313
DiscourseAi::Personas::Bot.as(

lib/personas/bot.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def build_json_schema(response_format)
319319
.to_a
320320
.reduce({}) do |memo, format|
321321
memo[format["key"].to_sym] = { type: format["type"] }
322+
memo[format["key"].to_sym][:items] = format["items"] if format["items"]
322323
memo
323324
end
324325

lib/personas/concept_finder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def system_prompt
4242
end
4343

4444
def response_format
45-
[{ "key" => "concepts", "type" => "array" }]
45+
[{ "key" => "concepts", "type" => "array", "items" => { "type" => "string" } }]
4646
end
4747
end
4848
end

0 commit comments

Comments
 (0)