lib/gen_ai/language/gemini.rb in gen-ai-0.4.0.alpha.3 vs lib/gen_ai/language/gemini.rb in gen-ai-0.4.0
- old
+ new
@@ -1,9 +1,10 @@
# frozen_string_literal: true
require 'faraday'
+require 'pry'
module GenAI
class Language
class Gemini < Base
include GenAI::Api::Format::Gemini
@@ -16,10 +17,10 @@
def complete(prompt, options = {}); end
def chat(messages, options = {})
response = client.post "/v1beta/models/gemini-pro:generateContent?key=#{@token}", {
- contents: messages.map(&:deep_symbolize_keys!),
+ contents: format_messages(messages),
generationConfig: options.except(:model)
}
build_result(model: 'gemini-pro', raw: response, parsed: extract_completions(response))
end