File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 11## [ Unreleased]
22
3+ ## [ 0.1.2] - 2023-06-20
4+ - Accept the ` model: ` param
5+
36## [ 0.1.1] - 2023-06-09
47- Fix the ` generate_chat_message() `
58
Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- google_palm_api (0.1.1 )
4+ google_palm_api (0.1.2 )
55 faraday (>= 1.0.0 )
66 faraday_middleware (>= 1.0.0 )
77
Original file line number Diff line number Diff line change @@ -47,9 +47,10 @@ def generate_text(
4747 top_k : nil ,
4848 safety_settings : nil ,
4949 stop_sequences : nil ,
50- client : nil
50+ client : nil ,
51+ model : nil
5152 )
52- response = connection . post ( "/v1beta2/models/#{ DEFAULTS [ :completion_model_name ] } :generateText" ) do |req |
53+ response = connection . post ( "/v1beta2/models/#{ model || DEFAULTS [ :completion_model_name ] } :generateText" ) do |req |
5354 req . params = { key : api_key }
5455
5556 req . body = { prompt : { text : prompt } }
@@ -93,10 +94,11 @@ def generate_chat_message(
9394 candidate_count : nil ,
9495 top_p : nil ,
9596 top_k : nil ,
96- client : nil
97+ client : nil ,
98+ model : nil
9799 )
98100 # Overwrite the default ENDPOINT_URL for this method.
99- response = connection . post ( "/v1beta2/models/#{ DEFAULTS [ :chat_completion_model_name ] } :generateMessage" ) do |req |
101+ response = connection . post ( "/v1beta2/models/#{ model || DEFAULTS [ :chat_completion_model_name ] } :generateMessage" ) do |req |
100102 req . params = { key : api_key }
101103
102104 req . body = { prompt : { } }
@@ -165,8 +167,8 @@ def list_models(page_size: nil, page_token: nil)
165167 # @param [String] prompt
166168 # @return [Hash]
167169 #
168- def count_message_tokens ( model :, prompt : )
169- response = connection . post ( "/v1beta2/models/#{ model } :countMessageTokens" ) do |req |
170+ def count_message_tokens ( prompt :, model : nil )
171+ response = connection . post ( "/v1beta2/models/#{ model || DEFAULTS [ :chat_completion_model_name ] } :countMessageTokens" ) do |req |
170172 req . params = { key : api_key }
171173
172174 req . body = { prompt : { messages : [ { content : prompt } ] } }
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module GooglePalmApi
4- VERSION = "0.1.1 "
4+ VERSION = "0.1.2 "
55end
You can’t perform that action at this time.
0 commit comments