lib/gen_ai/language/google_palm.rb in gen-ai-0.3.1 vs lib/gen_ai/language/google_palm.rb in gen-ai-0.3.2

- old
+ new

@@ -85,12 +85,12 @@ return [] if object.nil? object.respond_to?(:to_ary) ? object.to_ary || [object] : [object] end - def build_message(message, history) + def build_message(message, messages) if message.is_a?(String) - { author: history.dig(0, :role) || DEFAULT_ROLE, content: message } + { author: messages.dig(0, :author) || DEFAULT_ROLE, content: message } else message end end