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

Commit be6ad6c

Browse files
committed
lint
1 parent e091526 commit be6ad6c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/ai_bot/tool_runner.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,14 @@ def rag_search(query, filenames: nil, limit: 10)
117117
return [] if limit < 1
118118
limit = [MAX_FRAGMENTS, limit].min
119119

120-
upload_refs = UploadReference.where(target_id: tool.id, target_type: "AiTool").pluck(:upload_id)
120+
upload_refs =
121+
UploadReference.where(target_id: tool.id, target_type: "AiTool").pluck(:upload_id)
121122

122123
if filenames
123124
upload_refs = Upload.where(id: upload_refs).where(original_filename: filenames).pluck(:id)
124125
end
125126

126-
if upload_refs.empty?
127-
return []
128-
end
127+
return [] if upload_refs.empty?
129128

130129
strategy = DiscourseAi::Embeddings::Strategies::Truncation.new
131130
vector_rep =
@@ -137,7 +136,7 @@ def rag_search(query, filenames: nil, limit: 10)
137136
target_type: "AiTool",
138137
target_id: tool.id,
139138
limit: limit,
140-
offset: 0
139+
offset: 0,
141140
)
142141
fragments =
143142
RagDocumentFragment.where(id: fragment_ids, upload_id: upload_refs).pluck(

0 commit comments

Comments
 (0)