omniai 1.1.1 → 1.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: c22e433e659a447047be5c560093b288f71619b65c30d28c1f0b772a731f02b9
4
- data.tar.gz: c654b22f69ec301f4858e2ec82d9999e14f4b1aeb99b71edc4511410b8c77064
3
+ metadata.gz: facf65abfc03bc2fedc0572bbdebe5baca776da08b3eba9f4bde4b082bf037a7
4
+ data.tar.gz: 265613b4ab126f34d68d079241d8f4d2eae96c3e5c4f083aa9ff2761003a5678
5
5
  SHA512:
6
- metadata.gz: f1068c486faab118bb1171da1ec53a57a4f3b45625b2d5d74de3dc49df4d40c552cc99bab4f640d1cf4eed5693715002a49a14e487b1f75008962c85a158d157
7
- data.tar.gz: 3900c46ed2929cae7409b8b3048ef5339738414adfacee83a3b388a8ab93cea6e88d7031513647adafd136e6d1ddf0f9a0e553ea2a42d4de2013602f56919241
6
+ metadata.gz: a689d6591eabb97d47fea58a73c2b7fcc133c62aea51180bffe846976086b3819099708757cae85e20c5db3e38964b9dc7c0dc1cbc9fa8b076bc322a56dec4cb
7
+ data.tar.gz: bc80184100a4ca2888fb8a0ee3b93ac8d9d301e875e541e692b9a08564eb85fa59d58fcd88e35c4d72142624621ef73174b276c8da95ae53bfcabd1fc1ae776d
@@ -4,22 +4,20 @@ module OmniAI
4
4
  class Transcribe
5
5
  # A transcription returned by the API.
6
6
  class Transcription
7
- attr_accessor :data, :format
7
+ attr_accessor :text, :model, :format
8
8
 
9
- # @param data [Hash]
10
- def initialize(data:, format:)
11
- @data = data
9
+ # @param text [String]
10
+ # @param model [String]
11
+ # @param format [String]
12
+ def initialize(text:, model:, format:)
13
+ @text = text
14
+ @model = model
12
15
  @format = format
13
16
  end
14
17
 
15
- # @return [String]
16
- def text
17
- @data['text']
18
- end
19
-
20
18
  # @return [String]
21
19
  def inspect
22
- "#<#{self.class} text=#{text.inspect} format=#{format.inspect}>"
20
+ "#<#{self.class} text=#{text.inspect}>"
23
21
  end
24
22
  end
25
23
  end
@@ -119,8 +119,8 @@ module OmniAI
119
119
  response = request!
120
120
  raise HTTPError, response.flush unless response.status.ok?
121
121
 
122
- data = @format.nil? || @format.eql?(Format::JSON) ? response.parse : { text: String(response.body) }
123
- Transcription.new(format: @format, data:)
122
+ text = @format.nil? || @format.eql?(Format::JSON) ? response.parse['text'] : String(response.body)
123
+ Transcription.new(text:, model: @model, format: @format)
124
124
  end
125
125
 
126
126
  protected
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OmniAI
4
- VERSION = '1.1.1'
4
+ VERSION = '1.1.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre