ruby-openai 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +6 -6
- data/README.md +9 -9
- data/lib/ruby/openai/client.rb +8 -0
- data/lib/ruby/openai/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: 4fafce333da7c64cacff4af92a1aa6f9a6b852a6c84bcf139668ad6763e93be0
|
4
|
+
data.tar.gz: bd5ae87214057466912c2892123e5d1ab6efc2dc570cbbe00c13679417506706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1eac6b65e9ed0b8f932f0f9b65670df4a96e988a56c8ea302abbcf675b670917d4f1dd9289cfc0fa0be5868811888e0e67851338258ccfa8c5954fee82b1df6a
|
7
|
+
data.tar.gz: e1b856074548b44c228170c8f211737df30d1106edf5097d115df5b286447959bbbd30f6d7d3d8b33a88ebcd64303596240804192c710329b421749da8eac709
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [2.0.1] - 2022-10-22
|
9
|
+
|
10
|
+
### Removed
|
11
|
+
|
12
|
+
- Deprecate Client#answers endpoint.
|
13
|
+
- Deprecate Client#classifications endpoint.
|
14
|
+
|
8
15
|
## [2.0.0] - 2022-09-19
|
9
16
|
|
10
17
|
### Removed
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby-openai (2.0.
|
4
|
+
ruby-openai (2.0.1)
|
5
5
|
dotenv (>= 2.7.6, < 2.9.0)
|
6
6
|
httparty (>= 0.18.1, < 0.21.0)
|
7
7
|
|
@@ -31,7 +31,7 @@ GEM
|
|
31
31
|
public_suffix (4.0.7)
|
32
32
|
rainbow (3.1.1)
|
33
33
|
rake (13.0.6)
|
34
|
-
regexp_parser (2.
|
34
|
+
regexp_parser (2.6.0)
|
35
35
|
rexml (3.2.5)
|
36
36
|
rspec (3.11.0)
|
37
37
|
rspec-core (~> 3.11.0)
|
@@ -46,17 +46,17 @@ GEM
|
|
46
46
|
diff-lcs (>= 1.2.0, < 2.0)
|
47
47
|
rspec-support (~> 3.11.0)
|
48
48
|
rspec-support (3.11.0)
|
49
|
-
rubocop (1.
|
49
|
+
rubocop (1.37.0)
|
50
50
|
json (~> 2.3)
|
51
51
|
parallel (~> 1.10)
|
52
52
|
parser (>= 3.1.2.1)
|
53
53
|
rainbow (>= 2.2.2, < 4.0)
|
54
54
|
regexp_parser (>= 1.8, < 3.0)
|
55
55
|
rexml (>= 3.2.5, < 4.0)
|
56
|
-
rubocop-ast (>= 1.
|
56
|
+
rubocop-ast (>= 1.22.0, < 2.0)
|
57
57
|
ruby-progressbar (~> 1.7)
|
58
58
|
unicode-display_width (>= 1.4.0, < 3.0)
|
59
|
-
rubocop-ast (1.
|
59
|
+
rubocop-ast (1.22.0)
|
60
60
|
parser (>= 3.1.1.0)
|
61
61
|
ruby-progressbar (1.11.0)
|
62
62
|
unicode-display_width (2.3.0)
|
@@ -73,7 +73,7 @@ DEPENDENCIES
|
|
73
73
|
byebug (~> 11.1.3)
|
74
74
|
rake (~> 13.0)
|
75
75
|
rspec (~> 3.11)
|
76
|
-
rubocop (~> 1.
|
76
|
+
rubocop (~> 1.37.0)
|
77
77
|
ruby-openai!
|
78
78
|
vcr (~> 6.1.0)
|
79
79
|
webmock (~> 3.18.1)
|
data/README.md
CHANGED
@@ -59,6 +59,15 @@ Alternatively you can pass your key directly to a new client:
|
|
59
59
|
client = OpenAI::Client.new(access_token: "access_token_goes_here")
|
60
60
|
```
|
61
61
|
|
62
|
+
### Models
|
63
|
+
|
64
|
+
There are different models that can be used to generate text. For a full list and to retrieve information about a single models:
|
65
|
+
|
66
|
+
```ruby
|
67
|
+
client.models.list
|
68
|
+
client.models.retrieve(id: "text-ada-001")
|
69
|
+
```
|
70
|
+
|
62
71
|
#### Examples
|
63
72
|
|
64
73
|
- [GPT-3](https://beta.openai.com/docs/models/gpt-3)
|
@@ -70,15 +79,6 @@ Alternatively you can pass your key directly to a new client:
|
|
70
79
|
- code-davinci-002
|
71
80
|
- code-cushman-001
|
72
81
|
|
73
|
-
### Models
|
74
|
-
|
75
|
-
There are different models that can be used to generate text. For a full list and to retrieve information about a single models:
|
76
|
-
|
77
|
-
```ruby
|
78
|
-
client.models.list
|
79
|
-
client.models.retrieve(id: "text-ada-001")
|
80
|
-
```
|
81
|
-
|
82
82
|
### Completions
|
83
83
|
|
84
84
|
Hit the OpenAI API for a completion:
|
data/lib/ruby/openai/client.rb
CHANGED
@@ -8,10 +8,18 @@ module OpenAI
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def answers(version: default_version, parameters: {})
|
11
|
+
warn "[DEPRECATION WARNING] [ruby-openai] `Client#answers` is deprecated and will
|
12
|
+
be removed from the OpenAI API on 3 December 2022 and from ruby-openai v3.0.
|
13
|
+
More information: https://help.openai.com/en/articles/6233728-answers-transition-guide"
|
14
|
+
|
11
15
|
post(url: "/#{version}/answers", parameters: parameters)
|
12
16
|
end
|
13
17
|
|
14
18
|
def classifications(version: default_version, parameters: {})
|
19
|
+
warn "[DEPRECATION WARNING] [ruby-openai] `Client#classifications` is deprecated and will
|
20
|
+
be removed from the OpenAI API on 3 December 2022 and from ruby-openai v3.0.
|
21
|
+
More information: https://help.openai.com/en/articles/6272941-classifications-transition-guide"
|
22
|
+
|
15
23
|
post(url: "/#{version}/classifications", parameters: parameters)
|
16
24
|
end
|
17
25
|
|
data/lib/ruby/openai/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-openai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|