diff --git a/app/models/activity_extractor.rb b/app/models/activity_extractor.rb index 931277d..65ef0fc 100644 --- a/app/models/activity_extractor.rb +++ b/app/models/activity_extractor.rb @@ -79,8 +79,7 @@ def extract_activities! entry: self.record, title: activity["title"], summary: activity["summary"], - published_at: self.record.published_at, - scraped_at: self.record.scraped_at + published_at: self.record.published_at ) activity["impacted_promises"].each do |impacted_promise| diff --git a/app/models/chat.rb b/app/models/chat.rb index 08290ec..dba2bc4 100644 --- a/app/models/chat.rb +++ b/app/models/chat.rb @@ -19,6 +19,10 @@ def extract!(prompt) attributes = JSON.parse(message.content) + if attributes.nil? + raise "Nil response from LLM, message: #{message.inspect}" + end + self.update(attributes) end end