cohere-ruby 0.9.3 → 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 +4 -3
- data/lib/cohere/client.rb +4 -4
- data/lib/cohere/version.rb +1 -1
- metadata +10 -10
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
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cohere-ruby (0.9.
|
5
|
-
faraday (
|
6
|
-
faraday_middleware (
|
4
|
+
cohere-ruby (0.9.5)
|
5
|
+
faraday (>= 1.0.0)
|
6
|
+
faraday_middleware (>= 1.0.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -71,6 +71,7 @@ GEM
|
|
71
71
|
|
72
72
|
PLATFORMS
|
73
73
|
x86_64-darwin-19
|
74
|
+
x86_64-darwin-21
|
74
75
|
x86_64-linux
|
75
76
|
|
76
77
|
DEPENDENCIES
|
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,43 +1,43 @@
|
|
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
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday_middleware
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.0.0
|
41
41
|
description: Cohere API client for Ruby.
|
42
42
|
email:
|
43
43
|
- andrei.bondarev13@gmail.com
|