google_palm_api 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -2
- data/lib/google_palm_api/client.rb +8 -6
- data/lib/google_palm_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ac7103e077c1ab4551ab2c296f2eb3d99eb3b7359e59eea1a3b1b4bbdcfea815
|
|
4
|
+
data.tar.gz: ce2f516c03358ec6e1b320a333e2b630fd716565ed8c53e48528681a0c74eece
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eef61e7eb7981f6f12f5568deb359e5a71c2339d0696e4c6595b5521df9a5bb16649587ba0c773f2c563b9aa9b4d6a44403cf1f2634854f388ce40cf05644486
|
|
7
|
+
data.tar.gz: 963774e47464929a32a2dc92247a8ed171eb79efb1b911bd0be25a28bb7396490e627a155f198e45354e42b5e96c15a57974befe4935d1836f2f7d42609048c0
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# GooglePalmApi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Ruby API client for the Google PaLM APIs.
|
|
4
|
+
|
|
5
|
+
 [](https://badge.fury.io/rb/google_palm_api)
|
|
4
6
|
|
|
5
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/google_palm_api`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
6
7
|
|
|
7
8
|
## Installation
|
|
8
9
|
|
|
@@ -85,10 +85,10 @@ module GooglePalmApi
|
|
|
85
85
|
# @return [Hash]
|
|
86
86
|
#
|
|
87
87
|
def generate_chat_message(
|
|
88
|
-
|
|
88
|
+
messages:,
|
|
89
|
+
prompt: nil,
|
|
89
90
|
context: nil,
|
|
90
91
|
examples: nil,
|
|
91
|
-
messages: nil,
|
|
92
92
|
temperature: nil,
|
|
93
93
|
candidate_count: nil,
|
|
94
94
|
top_p: nil,
|
|
@@ -99,10 +99,12 @@ module GooglePalmApi
|
|
|
99
99
|
response = connection.post("/v1beta2/models/#{DEFAULTS[:chat_completion_model_name]}:generateMessage") do |req|
|
|
100
100
|
req.params = {key: api_key}
|
|
101
101
|
|
|
102
|
-
req.body = {prompt: {
|
|
103
|
-
|
|
104
|
-
req.body[:
|
|
105
|
-
req.body[:
|
|
102
|
+
req.body = {prompt: {}}
|
|
103
|
+
|
|
104
|
+
req.body[:prompt][:messages] = messages if messages
|
|
105
|
+
req.body[:prompt][:context] = context if context
|
|
106
|
+
req.body[:prompt][:examples] = examples if examples
|
|
107
|
+
|
|
106
108
|
req.body[:temperature] = temperature || DEFAULTS[:temperature]
|
|
107
109
|
req.body[:candidate_count] = candidate_count if candidate_count
|
|
108
110
|
req.body[:top_p] = top_p if top_p
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google_palm_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrei Bondarev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pry-byebug
|