openai_ruby 0.4.4 → 0.5.1

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: f2f23fff1edcd7d6c7a6bc1d605ab251ac74c4aaf29f8c9a3cb3b661cc479bfb
4
- data.tar.gz: 1cb460f0bb06b19e31121017ee63640dff99fbbda07b8a3487bbcf47a933aa54
3
+ metadata.gz: 43cca3a6a9e872aa7034f2ad8d2ffaae29c4611e3050ee20f2ee45ef79d2faa7
4
+ data.tar.gz: c5e9270b2a86cff363d13befa16106cdbe090eacf45d86883c3b7636cf18e7d8
5
5
  SHA512:
6
- metadata.gz: 3ae36726d144aaec060cad84594e962f4a1689cab2032e1d26ecc00d34229f621b035b072e8d741cadea205c30088fd9244b320b5b3745e6450984a9c893e8dd
7
- data.tar.gz: 3290de2a8a6a290c7a08a11035a30be26180ae4af372b433dcc55d3d53358f33e486b9a787eb5e843e700942f4c033c7e3c287c23c5c3248bebde5126412f7bc
6
+ metadata.gz: b0aa82059a59eb5035d1971792f900cc09cf5ad295066a145d18d75699c50d4c85c6e28719cebac2cba8c830d78d3c90238aecc0f0e0450d995d834a43f2c018
7
+ data.tar.gz: a1efa68b9d6bf3808dee5ea216be1fde0725bed68a7a38adf1db295c2d722b2c9d4f65e912b2ae75453026048b059f431be769cdd4e06c5c0151191083b03acb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openai_ruby (0.4.4)
4
+ openai_ruby (0.5.1)
5
5
  event_stream_parser (~> 1.0)
6
6
  faraday (~> 2.7)
7
7
 
@@ -60,13 +60,13 @@ module OpenAI
60
60
 
61
61
  if session
62
62
  boundary, body = build_multipart_body(sdp_offer, session)
63
- response = Faraday.post(uri) do |req|
63
+ Faraday.post(uri) do |req|
64
64
  req.headers["Authorization"] = "Bearer #{api_key}"
65
65
  req.headers["Content-Type"] = "multipart/form-data; boundary=#{boundary}"
66
66
  req.body = body
67
67
  end
68
68
  else
69
- response = Faraday.post(uri) do |req|
69
+ Faraday.post(uri) do |req|
70
70
  req.headers["Content-Type"] = "application/sdp"
71
71
  req.headers["Authorization"] = "Bearer #{api_key}"
72
72
  req.body = sdp_offer
@@ -83,7 +83,7 @@ module OpenAI
83
83
  def headers
84
84
  {
85
85
  "Content-Type" => "application/json",
86
- "Authorization" => "Bearer #{api_key}",
86
+ "Authorization" => "Bearer #{api_key}"
87
87
  }
88
88
  end
89
89
 
@@ -97,8 +97,9 @@ module OpenAI
97
97
  boundary = "----RubyFormBoundary#{SecureRandom.hex(16)}"
98
98
  parts = [
99
99
  ["--#{boundary}", 'Content-Disposition: form-data; name="sdp"', "Content-Type: application/sdp", "", sdp_offer],
100
- ["--#{boundary}", 'Content-Disposition: form-data; name="session"', "Content-Type: application/json", "", session.to_json],
101
- ["--#{boundary}--"],
100
+ ["--#{boundary}", 'Content-Disposition: form-data; name="session"', "Content-Type: application/json", "",
101
+ session.to_json],
102
+ ["--#{boundary}--"]
102
103
  ]
103
104
 
104
105
  [boundary, parts.flatten.join("\r\n")]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.4.4"
4
+ VERSION = "0.5.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openai_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renny Ren