ruby-openai 6.4.0 → 6.5.0

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: fb6b0c3d7f87d9db80a130891489e538f5abe737edd0faac2d95305b6b4f2071
4
- data.tar.gz: 79ca8323159be1b6b4aadac2712535a8ac09ca658d3b9b9312b753f625cf9546
3
+ metadata.gz: f3db6f0c15b1015a875950a23ad157cb9f6f4eaed2005c35f75fd97197ee3dd6
4
+ data.tar.gz: e11f7020b2db2d627646c584feb7dfb2163f3bd8233860e5115ffe0f8d65c681
5
5
  SHA512:
6
- metadata.gz: d3370f207d43c390ee0c0fd8d6fa7a3860877f0f6fefe27c0dfd17ae5d629162e37b5f02e627eb60737a47eef16f98a91f91fb10815256cb883b89e395f8a344
7
- data.tar.gz: 22c23aeda4f01a56d285a76c86dc36e6175ce95e027b69dbf69cc306953a612dd994b55f7e4966f9bfc751c5c6afa677acbc0339cc54a2cd4f1482a2b0594ab2
6
+ metadata.gz: 76100b527ed276b83190df15c1241be39d58288285e93caaeb20ca94c937082e1d19dd99b9ea69e1758352105e749e38940f1f0192b97c50fb18a8e81d321911
7
+ data.tar.gz: 425db82e5ae928dba3136351b697ac53335ffbce5afb81c98920efda2a0b4c600cf83a8273c8c627ad4b25a352ba76d2e77d88f00a48d4993dcbbc318077be53
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
+ ## [6.5.0] - 2024-03-31
9
+
10
+ ### Added
11
+
12
+ - Add back the deprecated Completions endpoint that I removed a bit prematurely. Thanks, [@mishranant](https://github.com/
13
+ mishranant) and everyone who requested this.
14
+
8
15
  ## [6.4.0] - 2024-03-27
9
16
 
10
17
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-openai (6.4.0)
4
+ ruby-openai (6.5.0)
5
5
  event_stream_parser (>= 0.3.0, < 2.0.0)
6
6
  faraday (>= 1)
7
7
  faraday-multipart (>= 1)
data/README.md CHANGED
@@ -399,6 +399,21 @@ end
399
399
  # => "The weather is nice 🌞"
400
400
  ```
401
401
 
402
+ ### Completions
403
+
404
+ Hit the OpenAI API for a completion using other GPT-3 models:
405
+
406
+ ```ruby
407
+ response = client.completions(
408
+ parameters: {
409
+ model: "text-davinci-001",
410
+ prompt: "Once upon a time",
411
+ max_tokens: 5
412
+ })
413
+ puts response["choices"].map { |c| c["text"] }
414
+ # => [", there lived a great"]
415
+ ```
416
+
402
417
  ### Edits
403
418
 
404
419
  Send a string and some instructions for what to do to the string:
data/lib/openai/client.rb CHANGED
@@ -34,6 +34,10 @@ module OpenAI
34
34
  json_post(path: "/embeddings", parameters: parameters)
35
35
  end
36
36
 
37
+ def completions(parameters: {})
38
+ json_post(path: "/completions", parameters: parameters)
39
+ end
40
+
37
41
  def audio
38
42
  @audio ||= OpenAI::Audio.new(client: self)
39
43
  end
@@ -1,3 +1,3 @@
1
1
  module OpenAI
2
- VERSION = "6.4.0".freeze
2
+ VERSION = "6.5.0".freeze
3
3
  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: 6.4.0
4
+ version: 6.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-27 00:00:00.000000000 Z
11
+ date: 2024-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: event_stream_parser