ruby-openai 4.3.1 → 4.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/lib/openai/client.rb +2 -2
- data/lib/openai/http.rb +8 -2
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9007c29faed86a4792fd80cd1081ddf18be51f71700ca7569dc05088bdf711fa
|
4
|
+
data.tar.gz: 6d190ab521aeada561ddaf72a5922d7d603d799a3e2e841e49ad5d9942c97bba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf02b7a6170d0497365b6dc1ee93e647f62f5eaf3080f3e27df42c58200c34b395aa8b7d0bfa1cec521bd00f4ede3a49983f40e074b8bb1d6dcba0a40a3373a5
|
7
|
+
data.tar.gz: 63d37b64f16825ff36314a66bb75b3188916fa03d2ee25e78f7dc7605a6734976c3678ac01fd398d4e96b0166d22de47a0f940c018b081c120c30d063dbc4963
|
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
9
9
|
|
10
10
|
### Fixed
|
11
11
|
|
12
|
+
- Don't overwrite config extra-headers when making a client without different ones. Thanks to [@swistaczek](https://github.com/swistaczek) for raising this!
|
13
|
+
- Include extra-headers for Azure requests.
|
14
|
+
|
15
|
+
## [4.3.1] - 2023-08-13
|
16
|
+
|
17
|
+
### Fixed
|
18
|
+
|
12
19
|
- Tempfiles can now be sent to the API as well as Files, eg for Whisper. Thanks to [@codergeek121](https://github.com/codergeek121) for the fix!
|
13
20
|
|
14
21
|
## [4.3.0] - 2023-08-12
|
data/Gemfile.lock
CHANGED
data/lib/openai/client.rb
CHANGED
@@ -3,12 +3,12 @@ module OpenAI
|
|
3
3
|
extend OpenAI::HTTP
|
4
4
|
|
5
5
|
def initialize(access_token: nil, organization_id: nil, uri_base: nil, request_timeout: nil,
|
6
|
-
extra_headers:
|
6
|
+
extra_headers: nil)
|
7
7
|
OpenAI.configuration.access_token = access_token if access_token
|
8
8
|
OpenAI.configuration.organization_id = organization_id if organization_id
|
9
9
|
OpenAI.configuration.uri_base = uri_base if uri_base
|
10
10
|
OpenAI.configuration.request_timeout = request_timeout if request_timeout
|
11
|
-
OpenAI.configuration.extra_headers = extra_headers
|
11
|
+
OpenAI.configuration.extra_headers = extra_headers if extra_headers
|
12
12
|
end
|
13
13
|
|
14
14
|
def chat(parameters: {})
|
data/lib/openai/http.rb
CHANGED
@@ -79,13 +79,19 @@ module OpenAI
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def headers
|
82
|
-
|
82
|
+
if OpenAI.configuration.api_type == :azure
|
83
|
+
azure_headers
|
84
|
+
else
|
85
|
+
openai_headers
|
86
|
+
end.merge(OpenAI.configuration.extra_headers || {})
|
87
|
+
end
|
83
88
|
|
89
|
+
def openai_headers
|
84
90
|
{
|
85
91
|
"Content-Type" => "application/json",
|
86
92
|
"Authorization" => "Bearer #{OpenAI.configuration.access_token}",
|
87
93
|
"OpenAI-Organization" => OpenAI.configuration.organization_id
|
88
|
-
}
|
94
|
+
}
|
89
95
|
end
|
90
96
|
|
91
97
|
def azure_headers
|
data/lib/openai/version.rb
CHANGED
data/lib/openai.rb
CHANGED
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: 4.3.
|
4
|
+
version: 4.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|