ruby-openai 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 313bb227de3cea2ce36b0f521e708490644c517abf08e2e68ac6f55ec975174a
4
- data.tar.gz: cfdf91ec66558f09f01a5b9b1c9d900504425b396b6471a5fa2acdef00cd58cb
3
+ metadata.gz: 71c408c413328ed3d7f4066f0c3acc607a6d2b6c9918ffe1bca87f8d3b343dcb
4
+ data.tar.gz: e1d93dc12a9de54840a8b962c9446217a85e53c7fc65e6b75ef4a396ade25c13
5
5
  SHA512:
6
- metadata.gz: 449a6b7a79e15d4717edc3634275cecb886f883da8efc0c1b99759954b417c95cbfcfdd62da7adae2077313aecb4028981676afa6d291c8f904bb598fa4221c8
7
- data.tar.gz: 6228927ccb6403db42c89d19fb357c61ab2016f07acceffe2c5b376dfb6dfaa7e14fc9d74326e00d8879f5233728b63bdaef57606c899f934b016ceba5accd64
6
+ metadata.gz: b66811a2da4ef122581cd8f7599db0930fffe4fa23008319e4df54067dca54ea8f4e0ac37f94cd120736fe8535a8cf613c63bb0661f13d01b33022d026eb74f9
7
+ data.tar.gz: e488a7710073d74f86e0ac1867757489d6861958aa9232a8e167865091678ef55445e4870baabe4c57cd8038f66feca4c01878adb39af044ded31d7a1f1f1c0b
@@ -5,7 +5,12 @@ 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
- ## [Unreleased]
8
+ ## [0.1.3] - 2020-09-09
9
+
10
+ ### Changed
11
+
12
+ - Add ability to change API version in the future.
13
+ - Fix README typos.
9
14
 
10
15
  ## [0.1.2] - 2020-09-09
11
16
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-openai (0.1.2)
4
+ ruby-openai (0.1.3)
5
5
  dotenv (~> 2.7.6)
6
6
  httparty (~> 0.18.1)
7
7
 
data/README.md CHANGED
@@ -31,7 +31,7 @@ Get your API key from [https://beta.openai.com/docs/developer-quickstart/your-ap
31
31
  If you're using [dotenv](https://github.com/motdotla/dotenv), you can add your secret key to your .env file:
32
32
 
33
33
  ```
34
- OPENAI_ACCESS_TOKEN=secretkeygoeshere
34
+ OPENAI_ACCESS_TOKEN=access_token_goes_here
35
35
  ```
36
36
 
37
37
  And create a client:
@@ -42,7 +42,7 @@ And create a client:
42
42
 
43
43
  ### Without dotenv
44
44
 
45
- Alternativeely you can pass your key directly to a new client:
45
+ Alternatively you can pass your key directly to a new client:
46
46
 
47
47
  ```
48
48
  client = OpenAI::Client.new(access_token: "access_token_goes_here")
@@ -1,15 +1,15 @@
1
1
  module OpenAI
2
2
  class Client
3
3
  include HTTParty
4
- base_uri "https://api.openai.com/v1/engines"
4
+ base_uri "https://api.openai.com"
5
5
 
6
6
  def initialize(access_token: nil)
7
7
  @access_token = access_token || ENV["OPENAI_ACCESS_TOKEN"]
8
8
  end
9
9
 
10
- def call(engine:, prompt:, max_tokens:)
10
+ def call(engine:, prompt:, max_tokens:, version: "v1")
11
11
  self.class.post(
12
- "/#{engine}/completions",
12
+ "/#{version}/engines/#{engine}/completions",
13
13
  headers: {
14
14
  "Content-Type" => "application/json",
15
15
  "Authorization" => "Bearer #{@access_token}"
@@ -1,5 +1,5 @@
1
1
  module Ruby
2
2
  module OpenAI
3
- VERSION = "0.1.2".freeze
3
+ VERSION = "0.1.3".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.2
4
+ version: 0.1.3
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-09 00:00:00.000000000 Z
11
+ date: 2020-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv