ruby-openai 0.1.1 → 0.1.2
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/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/README.md +17 -4
- data/lib/ruby/openai/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 313bb227de3cea2ce36b0f521e708490644c517abf08e2e68ac6f55ec975174a
|
|
4
|
+
data.tar.gz: cfdf91ec66558f09f01a5b9b1c9d900504425b396b6471a5fa2acdef00cd58cb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 449a6b7a79e15d4717edc3634275cecb886f883da8efc0c1b99759954b417c95cbfcfdd62da7adae2077313aecb4028981676afa6d291c8f904bb598fa4221c8
|
|
7
|
+
data.tar.gz: 6228927ccb6403db42c89d19fb357c61ab2016f07acceffe2c5b376dfb6dfaa7e14fc9d74326e00d8879f5233728b63bdaef57606c899f934b016ceba5accd64
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Smartphone (please complete the following information):**
|
|
32
|
+
- Device: [e.g. iPhone6]
|
|
33
|
+
- OS: [e.g. iOS8.1]
|
|
34
|
+
- Browser [e.g. stock browser, safari]
|
|
35
|
+
- Version [e.g. 22]
|
|
36
|
+
|
|
37
|
+
**Additional context**
|
|
38
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.2] - 2020-09-09
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add tests and cached responses for the different engines.
|
|
15
|
+
- Add issue templates.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Add README instructions for using the gem without dotenv.
|
|
20
|
+
- Add list of engines to README.
|
|
21
|
+
|
|
10
22
|
## [0.1.1] - 2020-09-08
|
|
11
23
|
|
|
12
24
|
### Added
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -26,23 +26,36 @@ Or install it yourself as:
|
|
|
26
26
|
|
|
27
27
|
Get your API key from [https://beta.openai.com/docs/developer-quickstart/your-api-keys](https://beta.openai.com/docs/developer-quickstart/your-api-keys)
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
### With dotenv
|
|
30
|
+
|
|
31
|
+
If you're using [dotenv](https://github.com/motdotla/dotenv), you can add your secret key to your .env file:
|
|
30
32
|
|
|
31
33
|
```
|
|
32
34
|
OPENAI_ACCESS_TOKEN=secretkeygoeshere
|
|
33
35
|
```
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
And create a client:
|
|
36
38
|
|
|
37
39
|
```
|
|
38
40
|
client = OpenAI::Client.new
|
|
39
41
|
```
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
### Without dotenv
|
|
44
|
+
|
|
45
|
+
Alternativeely you can pass your key directly to a new client:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
client = OpenAI::Client.new(access_token: "access_token_goes_here")
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Get a response
|
|
52
|
+
|
|
53
|
+
The engine options are currently "ada", "babbage", "curie" and "davinci". Hit the OpenAI API for a completion:
|
|
42
54
|
|
|
43
55
|
```
|
|
44
56
|
response = client.call(engine: "davinci", prompt: "Once upon a time", max_tokens: 5)
|
|
45
|
-
response.parsed_response['choices'].map{ |c| c["text"] }
|
|
57
|
+
puts response.parsed_response['choices'].map{ |c| c["text"] }
|
|
58
|
+
=> [", there lived a great"]
|
|
46
59
|
```
|
|
47
60
|
|
|
48
61
|
## Development
|
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: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-09-
|
|
11
|
+
date: 2020-09-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dotenv
|
|
@@ -46,6 +46,8 @@ extensions: []
|
|
|
46
46
|
extra_rdoc_files: []
|
|
47
47
|
files:
|
|
48
48
|
- ".circleci/config.yml"
|
|
49
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
|
50
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
|
49
51
|
- ".gitignore"
|
|
50
52
|
- ".rspec"
|
|
51
53
|
- ".rubocop.yml"
|