Skip to content

Commit

Permalink
Fix boolean generation
Browse files Browse the repository at this point in the history
  • Loading branch information
penguoir committed Feb 15, 2024
1 parent 80a0770 commit 9a8b745
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/active_cortex/generator/boolean.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ def save_generation
end

def generation
openai_content_as_boolean || raise(ActiveCortex::Error, openai_error_message)
if openai_content_as_boolean.nil?
raise(ActiveCortex::Error, openai_error_message)
else
openai_content_as_boolean
end
end

private

def openai_content_as_boolean
convert_to_boolean(openai_content)
@openai_content_as_boolean ||= convert_to_boolean(openai_content)
end

def openai_content
Expand Down

0 comments on commit 9a8b745

Please sign in to comment.