We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 775498f commit 7cf2afaCopy full SHA for 7cf2afa
lib/ruby_llm/active_record/acts_as.rb
@@ -143,14 +143,16 @@ def on_end_message(...)
143
self
144
end
145
146
- def create_user_message(content, with: nil)
+ def create_user_message(content, with: nil) # rubocop:disable Metrics/PerceivedComplexity
147
message_record = messages.create!(
148
role: :user,
149
content: content
150
)
151
152
if with.present?
153
- files = Array(with).reject(&:empty?)
+ files = Array(with).reject do |f|
154
+ f.nil? || (f.respond_to?(:empty?) && f.empty?) || (f.respond_to?(:blank?) && f.blank?)
155
+ end
156
157
if files.any?
158
if files.first.is_a?(ActionDispatch::Http::UploadedFile)
0 commit comments