ruby-openai 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile +3 -3
- data/Gemfile.lock +32 -31
- data/README.md +3 -3
- data/lib/ruby/openai/client.rb +0 -21
- data/lib/ruby/openai/version.rb +1 -1
- data/ruby-openai.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f49ef2d01087a09b453513bf5b4d19fa76ac1e650a96234be40cfe88ca70141
|
4
|
+
data.tar.gz: aa28c65f90677820fbc035c5f1dfaa885fdeb7ab5f613da746566f4a27194df5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8575de950acf0ad5c6439f59bd8718cd4ffdade7527ad8f5177ea95a35821bdf7d7f9535a105183dadb357f6ba322a14ba43bbbbae49dd4f782c646f9ced8a4d
|
7
|
+
data.tar.gz: 3f09519f5d3c364d03f9d4bb18269fe63e2670566884b099bf1c9862126c8fc10fcf30ac1774c699f8fc7c0f7fb1c57d5f677434e825421f76a5b9c6e0be13ed
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,17 @@ 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
|
+
## [1.0.0] - 2021-02-01
|
9
|
+
|
10
|
+
### Removed
|
11
|
+
|
12
|
+
- Remove deprecated method Client#call - use Client#completions instead.
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
- Rename 'master' branch to 'main' branch.
|
17
|
+
- Bump dependencies.
|
18
|
+
|
8
19
|
## [0.3.0] - 2020-11-22
|
9
20
|
|
10
21
|
### Added
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby-openai (0.
|
4
|
+
ruby-openai (1.0.0)
|
5
5
|
dotenv (~> 2.7.6)
|
6
6
|
httparty (~> 0.18.1)
|
7
7
|
|
@@ -10,9 +10,10 @@ GEM
|
|
10
10
|
specs:
|
11
11
|
addressable (2.7.0)
|
12
12
|
public_suffix (>= 2.0.2, < 5.0)
|
13
|
-
ast (2.4.
|
13
|
+
ast (2.4.2)
|
14
14
|
byebug (11.1.3)
|
15
|
-
crack (0.4.
|
15
|
+
crack (0.4.5)
|
16
|
+
rexml
|
16
17
|
diff-lcs (1.4.4)
|
17
18
|
dotenv (2.7.6)
|
18
19
|
hashdiff (1.0.1)
|
@@ -23,42 +24,42 @@ GEM
|
|
23
24
|
mime-types-data (~> 3.2015)
|
24
25
|
mime-types-data (3.2020.0512)
|
25
26
|
multi_xml (0.6.0)
|
26
|
-
parallel (1.
|
27
|
-
parser (
|
27
|
+
parallel (1.20.1)
|
28
|
+
parser (3.0.0.0)
|
28
29
|
ast (~> 2.4.1)
|
29
30
|
public_suffix (4.0.6)
|
30
31
|
rainbow (3.0.0)
|
31
|
-
rake (13.0.
|
32
|
-
regexp_parser (
|
32
|
+
rake (13.0.3)
|
33
|
+
regexp_parser (2.0.3)
|
33
34
|
rexml (3.2.4)
|
34
|
-
rspec (3.
|
35
|
-
rspec-core (~> 3.
|
36
|
-
rspec-expectations (~> 3.
|
37
|
-
rspec-mocks (~> 3.
|
38
|
-
rspec-core (3.
|
39
|
-
rspec-support (~> 3.
|
40
|
-
rspec-expectations (3.
|
35
|
+
rspec (3.10.0)
|
36
|
+
rspec-core (~> 3.10.0)
|
37
|
+
rspec-expectations (~> 3.10.0)
|
38
|
+
rspec-mocks (~> 3.10.0)
|
39
|
+
rspec-core (3.10.1)
|
40
|
+
rspec-support (~> 3.10.0)
|
41
|
+
rspec-expectations (3.10.1)
|
41
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
-
rspec-support (~> 3.
|
43
|
-
rspec-mocks (3.
|
43
|
+
rspec-support (~> 3.10.0)
|
44
|
+
rspec-mocks (3.10.1)
|
44
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
-
rspec-support (~> 3.
|
46
|
-
rspec-support (3.
|
47
|
-
rubocop (
|
46
|
+
rspec-support (~> 3.10.0)
|
47
|
+
rspec-support (3.10.1)
|
48
|
+
rubocop (1.9.0)
|
48
49
|
parallel (~> 1.10)
|
49
|
-
parser (>=
|
50
|
+
parser (>= 3.0.0.0)
|
50
51
|
rainbow (>= 2.2.2, < 4.0)
|
51
|
-
regexp_parser (>= 1.8)
|
52
|
+
regexp_parser (>= 1.8, < 3.0)
|
52
53
|
rexml
|
53
|
-
rubocop-ast (>=
|
54
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
54
55
|
ruby-progressbar (~> 1.7)
|
55
|
-
unicode-display_width (>= 1.4.0, <
|
56
|
-
rubocop-ast (
|
56
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
57
|
+
rubocop-ast (1.4.1)
|
57
58
|
parser (>= 2.7.1.5)
|
58
|
-
ruby-progressbar (1.
|
59
|
-
unicode-display_width (
|
59
|
+
ruby-progressbar (1.11.0)
|
60
|
+
unicode-display_width (2.0.0)
|
60
61
|
vcr (6.0.0)
|
61
|
-
webmock (3.
|
62
|
+
webmock (3.11.2)
|
62
63
|
addressable (>= 2.3.6)
|
63
64
|
crack (>= 0.3.2)
|
64
65
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -69,11 +70,11 @@ PLATFORMS
|
|
69
70
|
DEPENDENCIES
|
70
71
|
byebug (~> 11.1.3)
|
71
72
|
rake (~> 13.0)
|
72
|
-
rspec (~> 3.
|
73
|
-
rubocop (~>
|
73
|
+
rspec (~> 3.10)
|
74
|
+
rubocop (~> 1.9.0)
|
74
75
|
ruby-openai!
|
75
76
|
vcr (~> 6.0.0)
|
76
|
-
webmock (~> 3.
|
77
|
+
webmock (~> 3.11.2)
|
77
78
|
|
78
79
|
BUNDLED WITH
|
79
|
-
2.
|
80
|
+
2.2.3
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Ruby::OpenAI
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/ruby-openai.svg)](https://badge.fury.io/rb/ruby-openai)
|
4
|
-
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/alexrudall/ruby-openai/blob/
|
4
|
+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/alexrudall/ruby-openai/blob/main/LICENSE.txt)
|
5
5
|
[![CircleCI Build Status](https://circleci.com/gh/alexrudall/ruby-openai.svg?style=shield)](https://circleci.com/gh/alexrudall/ruby-openai)
|
6
6
|
|
7
7
|
A simple Ruby wrapper for the [OpenAI GPT-3 API](https://openai.com/blog/openai-api/).
|
@@ -76,7 +76,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
76
76
|
|
77
77
|
## Contributing
|
78
78
|
|
79
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/alexrudall/ruby-openai. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/alexrudall/ruby-openai/blob/
|
79
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/alexrudall/ruby-openai. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/alexrudall/ruby-openai/blob/main/CODE_OF_CONDUCT.md).
|
80
80
|
|
81
81
|
## License
|
82
82
|
|
@@ -84,4 +84,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
84
84
|
|
85
85
|
## Code of Conduct
|
86
86
|
|
87
|
-
Everyone interacting in the Ruby::OpenAI project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/alexrudall/ruby-openai/blob/
|
87
|
+
Everyone interacting in the Ruby::OpenAI project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/alexrudall/ruby-openai/blob/main/CODE_OF_CONDUCT.md).
|
data/lib/ruby/openai/client.rb
CHANGED
@@ -31,27 +31,6 @@ module OpenAI
|
|
31
31
|
)
|
32
32
|
end
|
33
33
|
|
34
|
-
# rubocop:disable Metrics/MethodLength
|
35
|
-
# rubocop:disable Layout/LineLength
|
36
|
-
def call(engine:, prompt:, max_tokens:, version: default_version)
|
37
|
-
warn "[DEPRECATION] `Client#call` is deprecated and will be removed in a future version of ruby-openai.
|
38
|
-
Please use `Client#completions` instead, like this:
|
39
|
-
client.completions(engine: 'davinci', parameters: { prompt: 'Once upon a time', max_tokens: 5 })
|
40
|
-
"
|
41
|
-
self.class.post(
|
42
|
-
"/#{version}/engines/#{engine}/completions",
|
43
|
-
headers: {
|
44
|
-
"Content-Type" => "application/json",
|
45
|
-
"Authorization" => "Bearer #{@access_token}"
|
46
|
-
},
|
47
|
-
body: {
|
48
|
-
prompt: prompt, max_tokens: max_tokens
|
49
|
-
}.to_json
|
50
|
-
)
|
51
|
-
end
|
52
|
-
# rubocop:enable Metrics/MethodLength
|
53
|
-
# rubocop:enable Layout/LineLength
|
54
|
-
|
55
34
|
private
|
56
35
|
|
57
36
|
def default_version
|
data/lib/ruby/openai/version.rb
CHANGED
data/ruby-openai.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
|
14
14
|
spec.metadata["homepage_uri"] = spec.homepage
|
15
15
|
spec.metadata["source_code_uri"] = "https://github.com/alexrudall/ruby-openai"
|
16
|
-
spec.metadata["changelog_uri"] = "https://github.com/alexrudall/ruby-openai/blob/
|
16
|
+
spec.metadata["changelog_uri"] = "https://github.com/alexrudall/ruby-openai/blob/main/CHANGELOG.md"
|
17
17
|
|
18
18
|
# Specify which files should be added to the gem when it is released.
|
19
19
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
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: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -71,7 +71,7 @@ licenses:
|
|
71
71
|
metadata:
|
72
72
|
homepage_uri: https://github.com/alexrudall/ruby-openai
|
73
73
|
source_code_uri: https://github.com/alexrudall/ruby-openai
|
74
|
-
changelog_uri: https://github.com/alexrudall/ruby-openai/blob/
|
74
|
+
changelog_uri: https://github.com/alexrudall/ruby-openai/blob/main/CHANGELOG.md
|
75
75
|
post_install_message:
|
76
76
|
rdoc_options: []
|
77
77
|
require_paths:
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
|
-
rubygems_version: 3.
|
90
|
+
rubygems_version: 3.2.3
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: A Ruby gem for the OpenAI GPT-3 API
|