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

Commit a33b705

Browse files
committed
lint
1 parent bc88e2d commit a33b705

File tree

5 files changed

+5
-15
lines changed

5 files changed

+5
-15
lines changed

app/models/ai_api_audit_log.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ module Provider
3434
# feature_name :string(255)
3535
# language_model :string(255)
3636
# feature_context :jsonb
37-

discourse_automation/llm_triage.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@
5252
flag_type = fields.dig("flag_type", "value")
5353
max_post_tokens = fields.dig("max_post_tokens", "value").to_i
5454

55-
if max_post_tokens <= 0
56-
max_post_tokens = nil
57-
end
55+
max_post_tokens = nil if max_post_tokens <= 0
5856

5957
begin
6058
RateLimiter.new(

lib/automation/llm_triage.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@ def self.handle(
3030

3131
content = "title: #{post.topic.title}\n#{post.raw}"
3232

33-
if max_post_tokens.present?
34-
content = llm.tokenizer.truncate(content, max_post_tokens)
35-
end
33+
content = llm.tokenizer.truncate(content, max_post_tokens) if max_post_tokens.present?
3634

3735
prompt.push(type: :user, content: content)
3836

3937
result = nil
4038

41-
4239
result =
4340
llm.generate(
4441
prompt,
@@ -49,7 +46,7 @@ def self.handle(
4946
feature_context: {
5047
automation_id: automation&.id,
5148
automation_name: automation&.name,
52-
}
49+
},
5350
)&.strip
5451

5552
if result.present? && result.downcase.include?(search_for_text.downcase)

lib/automation/report_runner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def run!
158158
feature_context: {
159159
automation_id: @automation&.id,
160160
automation_name: @automation&.name,
161-
}
161+
},
162162
) do |response|
163163
print response if Rails.env.development? && @debug_mode
164164
result << response

spec/lib/completions/llm_spec.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@
6565
total_tokens: 499,
6666
},
6767
choices: [
68-
{
69-
message: { role: "assistant", content: "test" },
70-
finish_reason: "stop",
71-
index: 0,
72-
},
68+
{ message: { role: "assistant", content: "test" }, finish_reason: "stop", index: 0 },
7369
],
7470
}.to_json
7571

0 commit comments

Comments
 (0)