ruby-openai 6.1.0 → 6.2.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: e1c1c4aa39c55d6c907ed312d12319d15dd2c4f5e68dc4d43d2a505c07869fb5
4
- data.tar.gz: ba6755693f91ce4f0ed1d03b2516e602f9eac382dde40f8241665618c9287767
3
+ metadata.gz: 4b77870afd356728570560cf1e2c7c703210f51db327c6d7e4c2d028d1979c12
4
+ data.tar.gz: f0b79c7776c0ff022f22f889923d3024f8a1d1894f47771105c9508c460739f3
5
5
  SHA512:
6
- metadata.gz: beaba2b0b90941e28b325950c9018a5a0a38f108989d7acce96ebdf84f761a01903e925d2f84812e6820bfd4917ace016590e18d4aee3960a7f6a936918ee445
7
- data.tar.gz: 6d423030d756769ba75f4837797384c7d4e9c99367bed3fe8141fc04f4f4b070f84643afc107ebf4d7a63666fd83c39fb154a2eb1463851a19a65f86672bae54
6
+ metadata.gz: 99f138cc6d2e4593191ca5833e4b81e9cc4b8a9b039010e0f43eb24c999ae413b530e4cd017b9c6a325264c7e8771a293b43c6e35daef50dd49f7568f6b11197
7
+ data.tar.gz: 2fdfbc69cdb6ee7b16693421704e7f9dda8bd0d1cc4da2c14ec2fdf6f3c8e380b3643462c799c69affddfc7a9f3e66983bb58d9965ee01e187245def25d99eb4
data/CHANGELOG.md CHANGED
@@ -5,6 +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
+ ## [6.2.0] - 2023-11-15
9
+
10
+ ### Added
11
+
12
+ - Add text-to-speech! Thank you [@codergeek121](https://github.com/codergeek121)
13
+
8
14
  ## [6.1.0] - 2023-11-14
9
15
 
10
16
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-openai (6.1.0)
4
+ ruby-openai (6.2.0)
5
5
  event_stream_parser (>= 0.3.0, < 1.0.0)
6
6
  faraday (>= 1)
7
7
  faraday-multipart (>= 1)
data/README.md CHANGED
@@ -460,6 +460,22 @@ puts response["text"]
460
460
  # => "Transcription of the text"
461
461
  ```
462
462
 
463
+ #### Speech
464
+
465
+ The speech API takes as input the text and a voice and returns the content of an audio file you can listen to.
466
+
467
+ ```ruby
468
+ response = client.audio.speech(
469
+ parameters: {
470
+ model: "tts-1",
471
+ input: "This is a speech test!",
472
+ voice: "alloy"
473
+ }
474
+ )
475
+ File.binwrite('demo.mp3', response)
476
+ # => mp3 file that plays: "This is a speech test!"
477
+ ```
478
+
463
479
  ### Errors
464
480
 
465
481
  HTTP errors can be caught like this:
data/lib/openai/audio.rb CHANGED
@@ -11,5 +11,9 @@ module OpenAI
11
11
  def translate(parameters: {})
12
12
  @client.multipart_post(path: "/audio/translations", parameters: parameters)
13
13
  end
14
+
15
+ def speech(parameters: {})
16
+ @client.json_post(path: "/audio/speech", parameters: parameters)
17
+ end
14
18
  end
15
19
  end
@@ -1,3 +1,3 @@
1
1
  module OpenAI
2
- VERSION = "6.1.0".freeze
2
+ VERSION = "6.2.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.1.0
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-14 00:00:00.000000000 Z
11
+ date: 2023-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: event_stream_parser