cohere-ruby 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -1
- data/lib/cohere/client.rb +4 -4
- data/lib/cohere/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: 7b0e0ed353f0966ed10f65a2cdbf51ed9fc4970ee94279ce21859b59913eb5ed
|
4
|
+
data.tar.gz: 228d57e4b64bc7abb49e0782674bfd052d2013a764686b7579d1ff7c489db08d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7c85f0c9e1498fdf679faf47e1a8f3daf343af701d1d77c74cf256b71530f543822e72b5a988018f5638d70d43771875dc6c6b9e402931a74d432e2b24a0a3d
|
7
|
+
data.tar.gz: 150f3bfa89f3707d6af9b7bbb5c95b72aafdc438789a14d33646b6656a446784fdb7dc04d0fab4cafaee1ff0b91eb3dfbf2ab7f701efbea1a20c0a801ea449e4
|
data/Gemfile.lock
CHANGED
data/lib/cohere/client.rb
CHANGED
@@ -83,16 +83,16 @@ module Cohere
|
|
83
83
|
response.body
|
84
84
|
end
|
85
85
|
|
86
|
-
def tokenize(text:)
|
86
|
+
def tokenize(text:, model: nil)
|
87
87
|
response = connection.post("tokenize") do |req|
|
88
|
-
req.body = {text: text}
|
88
|
+
req.body = model.nil? ? {text: text} : {text: text, model: model}
|
89
89
|
end
|
90
90
|
response.body
|
91
91
|
end
|
92
92
|
|
93
|
-
def detokenize(tokens:)
|
93
|
+
def detokenize(tokens:, model: nil)
|
94
94
|
response = connection.post("detokenize") do |req|
|
95
|
-
req.body = {tokens: tokens}
|
95
|
+
req.body = model.nil? ? {tokens: tokens} : {tokens: tokens, model: model}
|
96
96
|
end
|
97
97
|
response.body
|
98
98
|
end
|
data/lib/cohere/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cohere-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|