omniai 2.3.1 → 2.4.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: 9d7ae71d0e64d06d889cfe0b29345a892b8d17255b67687be2e71483bed23bda
4
- data.tar.gz: 964dc2c7103a949b01367f16d2252f2df188ce9844202f1674612b23234307e7
3
+ metadata.gz: 8b888dff5046dce34b72c4e1e37cad2ed2ce0a9a5259b1a998cc85567dc3f202
4
+ data.tar.gz: 14d100fd069b47cc0cd6a40794a0582639baf07384050d0e47a574a0062e01b9
5
5
  SHA512:
6
- metadata.gz: e4feb4a2a89185c32cc167f101509bb6bfece0a5f0658e75f92208f0481150e384285cc813fa03039cc3d1a5a51e985611d405e8e21d0eb0cc44cbacd4362b3c
7
- data.tar.gz: ce574823d457b180bf933497d756e729d8e8d40e59aeabe28fb2eeaf0cb6bbc9b30af7ebaec61aa4ca481b65f0ef6e8220a6ba8944ab213acce44d80dff46ba0
6
+ metadata.gz: 3a11e8b75566c699dd7f3c5bf2ae97a004bfb4ff0479e671dd7665db09970627666cacca21d72d11016ab4b783256e96799d66ea65f063492531a5a0320c025a
7
+ data.tar.gz: cc7e0e511676995ce72b092fd9238ba507f78bb371bc2eb6c1cff0d76ac27c3c28672f1ccd66da4360c4ff1294b6732301744bb4db06c97d51ac65580401dd60
@@ -9,7 +9,7 @@ module OmniAI
9
9
  attr_accessor :io
10
10
 
11
11
  # @param io [IO, Pathname, String]
12
- # @param type [Symbol, String] :image, :video, :audio, "audio/flac", "image/jpeg", "video/mpeg", etc.
12
+ # @param type [Symbol, String] "audio/flac", "image/jpeg", "video/mpeg", :audio, :image, :video, :document, etc.
13
13
  def initialize(io, type)
14
14
  super(type)
15
15
  @io = io
@@ -9,7 +9,7 @@ module OmniAI
9
9
  # @return [Symbol, String]
10
10
  attr_accessor :type
11
11
 
12
- # @param type [String] "audio/flac", "image/jpeg", "video/mpeg", etc.
12
+ # @param type [String] "audio/flac", "image/jpeg", "video/mpeg", "application/pdf", etc.
13
13
  def initialize(type)
14
14
  super()
15
15
  @type = type
@@ -40,12 +40,18 @@ module OmniAI
40
40
  @type.match?(%r{^video/})
41
41
  end
42
42
 
43
- # @return [:video, :audio, :image, :text]
43
+ # @return [Boolean]
44
+ def document?
45
+ @type.match?(%r{^application/pdf$})
46
+ end
47
+
48
+ # @return [:text, :audio, :image, :video :document]
44
49
  def kind
45
50
  if text? then :text
46
51
  elsif audio? then :audio
47
52
  elsif image? then :image
48
53
  elsif video? then :video
54
+ elsif document? then :document
49
55
  else
50
56
  raise(TypeError, "unsupported type=#{@type}")
51
57
  end
@@ -10,7 +10,7 @@ module OmniAI
10
10
  class FetchError < HTTPError; end
11
11
 
12
12
  # @param uri [URI, String] "https://example.com/cat.jpg"
13
- # @param type [Symbol, String] "audio/flac", "image/jpeg", "video/mpeg", :audi, :image, :video, etc.
13
+ # @param type [Symbol, String] "audio/flac", "image/jpeg", "video/mpeg", :audio, :image, :video, :document, etc.
14
14
  def initialize(uri, type = nil)
15
15
  super(type)
16
16
  @uri = uri
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OmniAI
4
- VERSION = "2.3.1"
4
+ VERSION = "2.4.0"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-04 00:00:00.000000000 Z
10
+ date: 2025-04-08 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: event_stream_parser