openai_ruby 0.3.3 → 0.3.4

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: 33013deb6a09941565ac13e9b3ee5de96d220b54c5c18f691201312237625ed1
4
- data.tar.gz: f0e635b8af085b9111f83e3575e125a6de7a931793df2f75cca27f84abb6ccac
3
+ metadata.gz: fbcaf002cd9527eee42cef58128dadfcc4e2bb68ea1594f2897b6f512960cf04
4
+ data.tar.gz: 2c53e131223a867ca02431988864f9a26e9127cb8c13f7dd7b00cac0938d5579
5
5
  SHA512:
6
- metadata.gz: e8b07aafb4694d054618c56808fd8e9fd12d246f24003c5d8ad1672dff02a75e9c91c2d656f0e537e9f25dfe2d1402a84ec3f0d0f8491a1310b06c936b483b09
7
- data.tar.gz: f32b7a3a048742c1d2ec478ede1082176ad00a7351ee7b9de094ab2e2315e7153b2de3c641d5474ba85109b21eddbe334209c4800060dd87bb89e8433e553765
6
+ metadata.gz: 63d7d58dc8d47d73b35469e500fe0f10164291e4ca673c859c0af57a6c588f4147dd010d568c297cef5cff540655d6627607d2e85e7e0c4366e0961725755acc
7
+ data.tar.gz: c2da02b0a4c211e8a4439b2c08b0b0f69694db28c6839baacc5aa2f33aa04611219eb38d7d363980efb726ea85cad33b5caa02a970a069c2f77189df4edf758b
data/Gemfile.lock ADDED
@@ -0,0 +1,64 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ openai_ruby (0.3.3)
5
+ faraday (~> 2.7)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ diff-lcs (1.5.0)
12
+ faraday (2.7.4)
13
+ faraday-net_http (>= 2.0, < 3.1)
14
+ ruby2_keywords (>= 0.0.4)
15
+ faraday-net_http (3.0.2)
16
+ json (2.6.3)
17
+ parallel (1.22.1)
18
+ parser (3.2.1.0)
19
+ ast (~> 2.4.1)
20
+ rainbow (3.1.1)
21
+ rake (13.0.6)
22
+ regexp_parser (2.7.0)
23
+ rexml (3.2.5)
24
+ rspec (3.12.0)
25
+ rspec-core (~> 3.12.0)
26
+ rspec-expectations (~> 3.12.0)
27
+ rspec-mocks (~> 3.12.0)
28
+ rspec-core (3.12.1)
29
+ rspec-support (~> 3.12.0)
30
+ rspec-expectations (3.12.2)
31
+ diff-lcs (>= 1.2.0, < 2.0)
32
+ rspec-support (~> 3.12.0)
33
+ rspec-mocks (3.12.3)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.12.0)
36
+ rspec-support (3.12.0)
37
+ rubocop (1.45.1)
38
+ json (~> 2.3)
39
+ parallel (~> 1.10)
40
+ parser (>= 3.2.0.0)
41
+ rainbow (>= 2.2.2, < 4.0)
42
+ regexp_parser (>= 1.8, < 3.0)
43
+ rexml (>= 3.2.5, < 4.0)
44
+ rubocop-ast (>= 1.24.1, < 2.0)
45
+ ruby-progressbar (~> 1.7)
46
+ unicode-display_width (>= 2.4.0, < 3.0)
47
+ rubocop-ast (1.26.0)
48
+ parser (>= 3.2.1.0)
49
+ ruby-progressbar (1.11.0)
50
+ ruby2_keywords (0.0.5)
51
+ unicode-display_width (2.4.2)
52
+
53
+ PLATFORMS
54
+ arm64-darwin-22
55
+ x86_64-linux
56
+
57
+ DEPENDENCIES
58
+ openai_ruby!
59
+ rake (~> 13.0)
60
+ rspec (~> 3.12)
61
+ rubocop (~> 1.45)
62
+
63
+ BUNDLED WITH
64
+ 2.4.6
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # OpenAI Ruby library
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/openai_ruby.svg)](https://badge.fury.io/rb/openai_ruby)
4
- [![Build Status](https://travis-ci.org/renny-ren/openai_ruby.svg?branch=main)](https://travis-ci.org/renny-ren/openai_ruby)
5
4
  [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/renny-ren/openai_ruby/blob/main/LICENSE)
6
5
 
7
6
  This is a Ruby wrapper for [OpenAI API](https://platform.openai.com/docs/api-reference), which provides convenient access to the OpenAI API from applications written in Ruby.
@@ -23,13 +23,11 @@ module OpenAI
23
23
  connection.post("/v1/chat/completions") do |req|
24
24
  req.body = params.to_json
25
25
  req.options.on_data = proc do |chunk, overall_received_bytes, env|
26
- if block_given?
27
- yield(chunk, overall_received_bytes, env)
28
- end
26
+ yield(chunk, overall_received_bytes, env) if block_given?
29
27
  end
30
28
  end
31
29
  else
32
- connection.post("/v1/chat/completions", params.to_json, headers)
30
+ connection.post("/v1/chat/completions", params.to_json)
33
31
  end
34
32
  end
35
33
 
@@ -41,6 +39,10 @@ module OpenAI
41
39
  )
42
40
  end
43
41
 
42
+ def images
43
+ @images ||= OpenAI::Images.new(connection)
44
+ end
45
+
44
46
  private
45
47
 
46
48
  def connection
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.4"
5
5
  end
data/lib/openai_ruby.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "faraday"
4
4
  require "openai_ruby/client"
5
+ require "openai_ruby/images"
5
6
  require "openai_ruby/version"
6
7
 
7
8
  module OpenAI
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openai_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renny Ren
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -36,6 +36,7 @@ files:
36
36
  - CHANGELOG.md
37
37
  - CODE_OF_CONDUCT.md
38
38
  - Gemfile
39
+ - Gemfile.lock
39
40
  - LICENSE
40
41
  - README.md
41
42
  - Rakefile