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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 100378df0cba6c07efb76083f5f74fac7a2c3cd0c3d94ce7eb82e81919182262
4
- data.tar.gz: 14cbb7954884e1b0860b2408b92b6c366f0fffe7d665b07bc6bb9276778f1fe4
3
+ metadata.gz: 313bb227de3cea2ce36b0f521e708490644c517abf08e2e68ac6f55ec975174a
4
+ data.tar.gz: cfdf91ec66558f09f01a5b9b1c9d900504425b396b6471a5fa2acdef00cd58cb
5
5
  SHA512:
6
- metadata.gz: fc4e80b899ccb6de28790cc8193a0ce99c95e0aa66f71b6aadcb0b39c6bd1f2081fdc64a49e01e481ae94ccc2bfdecd8029885a1dea286bfb91dd20870f9d6c5
7
- data.tar.gz: 383de94193c910154b142f350d80b5ca8e45dfb434bbb79c6c5b14b6faf49fd3fed39681591a0f4d591fde6f6cf532dc8c1510f9b73d0d04e1bab7d380c7dd7c
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.
@@ -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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-openai (0.1.1)
4
+ ruby-openai (0.1.2)
5
5
  dotenv (~> 2.7.6)
6
6
  httparty (~> 0.18.1)
7
7
 
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
- Add your secret key to your .env file:
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
- Create a client:
37
+ And create a client:
36
38
 
37
39
  ```
38
40
  client = OpenAI::Client.new
39
41
  ```
40
42
 
41
- Use it to hit the OpenAI API for a completion:
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
@@ -1,5 +1,5 @@
1
1
  module Ruby
2
2
  module OpenAI
3
- VERSION = "0.1.1".freeze
3
+ VERSION = "0.1.2".freeze
4
4
  end
5
5
  end
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.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-07 00:00:00.000000000 Z
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"