openai-chat 0.0.2 → 0.0.3
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 +4 -4
- data/.rspec +3 -0
- data/.standard.yml +11 -0
- data/Gemfile.lock +113 -1
- data/README.md +84 -27
- data/Rakefile +10 -0
- data/lib/openai/chat/version.rb +1 -1
- data/lib/openai/chat.rb +142 -7
- data/lib/openai-chat.rb +10 -0
- metadata +105 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82f44ec692941bead59c002656f2bf520b4bfa61228ece8e885e2c96fb946e1a
|
4
|
+
data.tar.gz: e88e9127a305b73a6407f8cbb34725187c1c30f981c1008c672a8c18146673cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bacb325cadef5c7d6846d550041b11e207e26681707d0ef399926d6e87196594bf06a29211dc4825b0134d4b9067c5129f9422e0260a6c78d2f127d02b665f56
|
7
|
+
data.tar.gz: 13f1ffa286c1627c2777390177d84dc5dfc96b33293a072370e938de0b18e9fbb898e4cfcd080118231502b3fb107e47b11370fae6e753cef589b632a9e286c7
|
data/.rspec
ADDED
data/.standard.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,17 +1,129 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openai-chat (0.0.
|
4
|
+
openai-chat (0.0.3)
|
5
|
+
mime-types (~> 3.0)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
10
|
+
activesupport (8.0.1)
|
11
|
+
base64
|
12
|
+
benchmark (>= 0.3)
|
13
|
+
bigdecimal
|
14
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
15
|
+
connection_pool (>= 2.2.5)
|
16
|
+
drb
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
logger (>= 1.4.2)
|
19
|
+
minitest (>= 5.1)
|
20
|
+
securerandom (>= 0.3)
|
21
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
22
|
+
uri (>= 0.13.1)
|
23
|
+
addressable (2.8.7)
|
24
|
+
public_suffix (>= 2.0.2, < 7.0)
|
25
|
+
ast (2.4.2)
|
26
|
+
base64 (0.2.0)
|
27
|
+
benchmark (0.4.0)
|
28
|
+
bigdecimal (3.1.9)
|
29
|
+
concurrent-ruby (1.3.5)
|
30
|
+
connection_pool (2.5.0)
|
31
|
+
crack (1.0.0)
|
32
|
+
bigdecimal
|
33
|
+
rexml
|
34
|
+
diff-lcs (1.6.0)
|
35
|
+
drb (2.2.1)
|
36
|
+
factory_bot (6.5.1)
|
37
|
+
activesupport (>= 6.1.0)
|
38
|
+
hashdiff (1.1.2)
|
39
|
+
i18n (1.14.7)
|
40
|
+
concurrent-ruby (~> 1.0)
|
41
|
+
json (2.10.1)
|
42
|
+
language_server-protocol (3.17.0.4)
|
43
|
+
lint_roller (1.1.0)
|
44
|
+
logger (1.6.6)
|
45
|
+
mime-types (3.6.0)
|
46
|
+
logger
|
47
|
+
mime-types-data (~> 3.2015)
|
48
|
+
mime-types-data (3.2025.0304)
|
49
|
+
minitest (5.25.4)
|
50
|
+
parallel (1.26.3)
|
51
|
+
parser (3.3.7.1)
|
52
|
+
ast (~> 2.4.1)
|
53
|
+
racc
|
54
|
+
public_suffix (6.0.1)
|
55
|
+
racc (1.8.1)
|
56
|
+
rainbow (3.1.1)
|
57
|
+
rake (13.2.1)
|
58
|
+
regexp_parser (2.10.0)
|
59
|
+
rexml (3.4.1)
|
60
|
+
rspec (3.13.0)
|
61
|
+
rspec-core (~> 3.13.0)
|
62
|
+
rspec-expectations (~> 3.13.0)
|
63
|
+
rspec-mocks (~> 3.13.0)
|
64
|
+
rspec-core (3.13.3)
|
65
|
+
rspec-support (~> 3.13.0)
|
66
|
+
rspec-expectations (3.13.3)
|
67
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
68
|
+
rspec-support (~> 3.13.0)
|
69
|
+
rspec-mocks (3.13.2)
|
70
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
71
|
+
rspec-support (~> 3.13.0)
|
72
|
+
rspec-support (3.13.2)
|
73
|
+
rubocop (1.69.2)
|
74
|
+
json (~> 2.3)
|
75
|
+
language_server-protocol (>= 3.17.0)
|
76
|
+
parallel (~> 1.10)
|
77
|
+
parser (>= 3.3.0.2)
|
78
|
+
rainbow (>= 2.2.2, < 4.0)
|
79
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
80
|
+
rubocop-ast (>= 1.36.2, < 2.0)
|
81
|
+
ruby-progressbar (~> 1.7)
|
82
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
83
|
+
rubocop-ast (1.38.1)
|
84
|
+
parser (>= 3.3.1.0)
|
85
|
+
rubocop-performance (1.23.0)
|
86
|
+
rubocop (>= 1.48.1, < 2.0)
|
87
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
88
|
+
ruby-progressbar (1.13.0)
|
89
|
+
securerandom (0.4.1)
|
90
|
+
standard (1.43.0)
|
91
|
+
language_server-protocol (~> 3.17.0.2)
|
92
|
+
lint_roller (~> 1.0)
|
93
|
+
rubocop (~> 1.69.1)
|
94
|
+
standard-custom (~> 1.0.0)
|
95
|
+
standard-performance (~> 1.6)
|
96
|
+
standard-custom (1.0.2)
|
97
|
+
lint_roller (~> 1.0)
|
98
|
+
rubocop (~> 1.50)
|
99
|
+
standard-performance (1.6.0)
|
100
|
+
lint_roller (~> 1.1)
|
101
|
+
rubocop-performance (~> 1.23.0)
|
102
|
+
tzinfo (2.0.6)
|
103
|
+
concurrent-ruby (~> 1.0)
|
104
|
+
unicode-display_width (3.1.4)
|
105
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
106
|
+
unicode-emoji (4.0.4)
|
107
|
+
uri (1.0.3)
|
108
|
+
vcr (6.3.1)
|
109
|
+
base64
|
110
|
+
webmock (3.25.0)
|
111
|
+
addressable (>= 2.8.0)
|
112
|
+
crack (>= 0.3.2)
|
113
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
9
114
|
|
10
115
|
PLATFORMS
|
116
|
+
arm64-darwin-23
|
11
117
|
x86_64-linux
|
12
118
|
|
13
119
|
DEPENDENCIES
|
120
|
+
factory_bot (~> 6.2)
|
14
121
|
openai-chat!
|
122
|
+
rake (~> 13.0)
|
123
|
+
rspec (~> 3.12)
|
124
|
+
standard (~> 1.32)
|
125
|
+
vcr (~> 6.1)
|
126
|
+
webmock (~> 3.18)
|
15
127
|
|
16
128
|
BUNDLED WITH
|
17
129
|
2.3.7
|
data/README.md
CHANGED
@@ -2,7 +2,40 @@
|
|
2
2
|
|
3
3
|
This gem provides a class called `OpenAI::Chat` that is intended to make it as easy as possible to use OpenAI's Chat Completions endpoint.
|
4
4
|
|
5
|
-
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem "openai-chat", github: "firstdraft/openai-chat"
|
11
|
+
```
|
12
|
+
|
13
|
+
And then, at a command prompt:
|
14
|
+
|
15
|
+
```
|
16
|
+
bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
Or, install it directly with:
|
20
|
+
|
21
|
+
```
|
22
|
+
gem install openai-chat
|
23
|
+
```
|
24
|
+
|
25
|
+
## Configuration
|
26
|
+
|
27
|
+
- By default, the gem assumes you have an environment variable called exactly `OPENAI_TOKEN`. If not, you can also provide your token when instantiating a chat:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
x = OpenAI::Chat.new(api_token: "your-token-goes-here")
|
31
|
+
```
|
32
|
+
- By default, the gem uses the `gpt-4o` model. If you want something else, you can set it:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
x.model = "o3-mini"
|
36
|
+
```
|
37
|
+
|
38
|
+
## Simplest usage
|
6
39
|
|
7
40
|
```ruby
|
8
41
|
x = OpenAI::Chat.new
|
@@ -16,7 +49,9 @@ x.assistant!
|
|
16
49
|
# => "Ah, the fair and bustling city of Chicago, renowned for its deep-dish delight that hath captured hearts and stomachs aplenty. Amongst the many offerings of this great city, 'tis often said that Lou Malnati's and Giordano's art the titans of the deep-dish realm. Lou Malnati's crust is praised for its buttery crispness, whilst Giordano's doth boast a stuffed creation that is nigh unto legendary. Yet, I encourage thee to embark upon thine own quest and savor the offerings of these famed establishments, for in the tasting lies the truth of which thy palate prefers. Enjoy the gastronomic adventure, my friend."
|
17
50
|
```
|
18
51
|
|
19
|
-
|
52
|
+
## Structured Output
|
53
|
+
|
54
|
+
Get back Structured Output by setting the `schema` attribute (I suggest using [OpenAI's handy tool for generating the JSON Schema](https://platform.openai.com/docs/guides/structured-outputs)):
|
20
55
|
|
21
56
|
```ruby
|
22
57
|
x = OpenAI::Chat.new
|
@@ -27,50 +62,72 @@ x.assistant!
|
|
27
62
|
# => {"fat"=>15, "protein"=>5, "carbs"=>50, "total_calories"=>350}
|
28
63
|
```
|
29
64
|
|
30
|
-
|
65
|
+
## Include images
|
31
66
|
|
32
|
-
|
67
|
+
You can include images in your chat messages using the `user` method with the `image` or `images` parameter:
|
33
68
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
- By default, the gem uses the `gpt-4o` model. If you want something else, you can set it:
|
69
|
+
```ruby
|
70
|
+
# Send a single image
|
71
|
+
x.user("What's in this image?", image: "path/to/local/image.jpg")
|
38
72
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
- You can call `.messages` to get an array containing the conversation so far.
|
43
|
-
- You can manually set the assistant message
|
44
|
-
```rb
|
45
|
-
x.assistant("Greetings, good sir or madam! How dost thou fare on this fine day? Pray, tell me how I may be of service to thee.")
|
46
|
-
```
|
73
|
+
# Send multiple images
|
74
|
+
x.user("What are these images showing?", images: ["path/to/image1.jpg", "https://example.com/image2.jpg"])
|
75
|
+
```
|
47
76
|
|
48
|
-
|
77
|
+
The gem supports three types of image inputs:
|
49
78
|
|
50
|
-
|
79
|
+
- URLs: Pass an image URL starting with `http://` or `https://`.
|
80
|
+
- File paths: Pass a string with a path to a local image file.
|
81
|
+
- File-like objects: Pass an object that responds to `read` (like `File.open("image.jpg")` or a Rails uploaded file).
|
51
82
|
|
52
|
-
|
83
|
+
You can send multiple images, and place them between bits of text, in a single user message:
|
53
84
|
|
54
85
|
```ruby
|
55
|
-
|
86
|
+
z = OpenAI::Chat.new
|
87
|
+
z.user(
|
88
|
+
[
|
89
|
+
{"image" => "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Eubalaena_glacialis_with_calf.jpg/215px-Eubalaena_glacialis_with_calf.jpg"},
|
90
|
+
{"text" => "What is in the above image? What is in the below image?"},
|
91
|
+
{"image" => "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Elephant_Diversity.jpg/305px-Elephant_Diversity.jpg"},
|
92
|
+
{"text" => "What are the differences between the images?"}
|
93
|
+
]
|
94
|
+
)
|
95
|
+
z.assistant!
|
56
96
|
```
|
57
97
|
|
58
|
-
|
98
|
+
Both string and symbol keys are supported for the hash items:
|
59
99
|
|
60
|
-
```
|
61
|
-
|
100
|
+
```ruby
|
101
|
+
z = OpenAI::Chat.new
|
102
|
+
z.user(
|
103
|
+
[
|
104
|
+
{image: "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Eubalaena_glacialis_with_calf.jpg/215px-Eubalaena_glacialis_with_calf.jpg"},
|
105
|
+
{text: "What is in the above image? What is in the below image?"},
|
106
|
+
{image: "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Elephant_Diversity.jpg/305px-Elephant_Diversity.jpg"},
|
107
|
+
{text: "What are the differences between the images?"}
|
108
|
+
]
|
109
|
+
)
|
110
|
+
z.assistant!
|
62
111
|
```
|
63
112
|
|
64
|
-
|
113
|
+
## Set assistant messages manually
|
65
114
|
|
115
|
+
You can manually add assistant messages:
|
116
|
+
|
117
|
+
```rb
|
118
|
+
x.assistant("Greetings, good sir or madam! How dost thou fare on this fine day? Pray, tell me how I may be of service to thee.")
|
66
119
|
```
|
67
|
-
|
68
|
-
|
120
|
+
|
121
|
+
Useful if you are reconstructing old messages from a chat that has already happened.
|
122
|
+
|
123
|
+
## Getting and setting messages directly
|
124
|
+
|
125
|
+
- You can call `.messages` to get an array containing the conversation so far.
|
126
|
+
- TODO: Setting `.messages` will replace the conversation with the provided array.
|
69
127
|
|
70
128
|
## TODOs
|
71
129
|
|
72
130
|
- Add a `reasoning_effort` parameter.
|
73
|
-
- Add the ability to send images.
|
74
131
|
- Add the ability to set all messages at once, ideally with an ActiveRecord Relation.
|
75
132
|
- Add a way to access the whole API response body (rather than just the message content).
|
76
133
|
- Add specs.
|
data/Rakefile
ADDED
data/lib/openai/chat/version.rb
CHANGED
data/lib/openai/chat.rb
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require "net/http"
|
5
|
-
require "uri"
|
6
|
-
require "json"
|
3
|
+
# All dependencies are now required in the main openai-chat.rb file
|
7
4
|
|
8
5
|
module OpenAI
|
9
6
|
class Chat
|
@@ -19,8 +16,78 @@ module OpenAI
|
|
19
16
|
messages.push({role: "system", content: content})
|
20
17
|
end
|
21
18
|
|
22
|
-
def user(content)
|
23
|
-
|
19
|
+
def user(content, image: nil, images: nil)
|
20
|
+
if content.is_a?(Array)
|
21
|
+
processed_content = content.map do |item|
|
22
|
+
if item.key?("image") || item.key?(:image)
|
23
|
+
image_value = item.fetch("image") { item.fetch(:image) }
|
24
|
+
{
|
25
|
+
type: "image_url",
|
26
|
+
image_url: {
|
27
|
+
url: process_image(image_value)
|
28
|
+
}
|
29
|
+
}
|
30
|
+
elsif item.key?("text") || item.key?(:text)
|
31
|
+
text_value = item.fetch("text") { item.fetch(:text) }
|
32
|
+
{
|
33
|
+
type: "text",
|
34
|
+
text: text_value
|
35
|
+
}
|
36
|
+
else
|
37
|
+
item
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
messages.push(
|
42
|
+
{
|
43
|
+
role: "user",
|
44
|
+
content: processed_content
|
45
|
+
}
|
46
|
+
)
|
47
|
+
elsif image.nil? && images.nil?
|
48
|
+
messages.push(
|
49
|
+
{
|
50
|
+
role: "user",
|
51
|
+
content: content
|
52
|
+
}
|
53
|
+
)
|
54
|
+
else
|
55
|
+
text_and_images_array = [
|
56
|
+
{
|
57
|
+
type: "text",
|
58
|
+
text: content
|
59
|
+
}
|
60
|
+
]
|
61
|
+
|
62
|
+
if images && !images.empty?
|
63
|
+
images_array = images.map do |image|
|
64
|
+
{
|
65
|
+
type: "image_url",
|
66
|
+
image_url: {
|
67
|
+
url: process_image(image)
|
68
|
+
}
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
text_and_images_array += images_array
|
73
|
+
else
|
74
|
+
text_and_images_array.push(
|
75
|
+
{
|
76
|
+
type: "image_url",
|
77
|
+
image_url: {
|
78
|
+
url: process_image(image)
|
79
|
+
}
|
80
|
+
}
|
81
|
+
)
|
82
|
+
end
|
83
|
+
|
84
|
+
messages.push(
|
85
|
+
{
|
86
|
+
role: "user",
|
87
|
+
content: text_and_images_array
|
88
|
+
}
|
89
|
+
)
|
90
|
+
end
|
24
91
|
end
|
25
92
|
|
26
93
|
def assistant(content)
|
@@ -30,7 +97,7 @@ module OpenAI
|
|
30
97
|
def assistant!
|
31
98
|
request_headers_hash = {
|
32
99
|
"Authorization" => "Bearer #{@api_token}",
|
33
|
-
"content-type" => "application/json"
|
100
|
+
"content-type" => "application/json"
|
34
101
|
}
|
35
102
|
|
36
103
|
response_format = if schema.nil?
|
@@ -71,5 +138,73 @@ module OpenAI
|
|
71
138
|
def inspect
|
72
139
|
"#<#{self.class.name} @messages=#{messages.inspect} @model=#{@model.inspect} @schema=#{@schema.inspect}>"
|
73
140
|
end
|
141
|
+
|
142
|
+
private
|
143
|
+
|
144
|
+
# Custom exception class for input classification errors.
|
145
|
+
class InputClassificationError < StandardError; end
|
146
|
+
|
147
|
+
def classify_obj(obj)
|
148
|
+
if obj.is_a?(String)
|
149
|
+
# Attempt to parse as a URL.
|
150
|
+
begin
|
151
|
+
uri = URI.parse(obj)
|
152
|
+
if uri.is_a?(URI::HTTP) || uri.is_a?(URI::HTTPS)
|
153
|
+
return :url
|
154
|
+
end
|
155
|
+
rescue URI::InvalidURIError
|
156
|
+
# Not a valid URL; continue to check if it's a file path.
|
157
|
+
end
|
158
|
+
|
159
|
+
# Check if the string represents a local file path (must exist on disk).
|
160
|
+
if File.exist?(obj)
|
161
|
+
:file_path
|
162
|
+
else
|
163
|
+
raise InputClassificationError,
|
164
|
+
"String provided is neither a valid URL (must start with http:// or https://) nor an existing file path on disk. Received value: #{obj.inspect}"
|
165
|
+
end
|
166
|
+
elsif obj.respond_to?(:read)
|
167
|
+
# For non-String objects, check if it behaves like a file.
|
168
|
+
:file_like
|
169
|
+
else
|
170
|
+
raise InputClassificationError,
|
171
|
+
"Object provided is neither a String nor file-like (missing :read method). Received value: #{obj.inspect}"
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
def process_image(obj)
|
176
|
+
case classify_obj(obj)
|
177
|
+
when :url
|
178
|
+
obj
|
179
|
+
when :file_path
|
180
|
+
file_path = obj
|
181
|
+
|
182
|
+
mime_type = MIME::Types.type_for(file_path).first.to_s
|
183
|
+
|
184
|
+
image_data = File.binread(file_path)
|
185
|
+
|
186
|
+
base64_string = Base64.strict_encode64(image_data)
|
187
|
+
|
188
|
+
"data:#{mime_type};base64,#{base64_string}"
|
189
|
+
when :file_like
|
190
|
+
filename = if obj.respond_to?(:path)
|
191
|
+
obj.path
|
192
|
+
elsif obj.respond_to?(:original_filename)
|
193
|
+
obj.original_filename
|
194
|
+
else
|
195
|
+
"unknown"
|
196
|
+
end
|
197
|
+
|
198
|
+
mime_type = MIME::Types.type_for(filename).first.to_s
|
199
|
+
mime_type = "image/jpeg" if mime_type.empty?
|
200
|
+
|
201
|
+
image_data = obj.read
|
202
|
+
obj.rewind if obj.respond_to?(:rewind)
|
203
|
+
|
204
|
+
base64_string = Base64.strict_encode64(image_data)
|
205
|
+
|
206
|
+
"data:#{mime_type};base64,#{base64_string}"
|
207
|
+
end
|
208
|
+
end
|
74
209
|
end
|
75
210
|
end
|
data/lib/openai-chat.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,113 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openai-chat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raghu Betina
|
8
8
|
- Jelani Woods
|
9
|
-
autorequire:
|
10
9
|
bindir: exe
|
11
10
|
cert_chain: []
|
12
|
-
date: 2025-03-
|
13
|
-
dependencies:
|
11
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mime-types
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '13.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '13.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: factory_bot
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '6.2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '6.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.18'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.18'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: vcr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '6.1'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '6.1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: standard
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.32'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.32'
|
14
111
|
description: This gem provides a class called `OpenAI::Chat` that is intended to make
|
15
112
|
it as easy as possible to use OpenAI's Chat Completions endpoint. Supports Structured
|
16
113
|
Output.
|
@@ -21,12 +118,15 @@ executables: []
|
|
21
118
|
extensions: []
|
22
119
|
extra_rdoc_files: []
|
23
120
|
files:
|
121
|
+
- ".rspec"
|
122
|
+
- ".standard.yml"
|
24
123
|
- CHANGELOG.md
|
25
124
|
- CODE_OF_CONDUCT.md
|
26
125
|
- Gemfile
|
27
126
|
- Gemfile.lock
|
28
127
|
- LICENSE.txt
|
29
128
|
- README.md
|
129
|
+
- Rakefile
|
30
130
|
- lib/openai-chat.rb
|
31
131
|
- lib/openai/chat.rb
|
32
132
|
- lib/openai/chat/version.rb
|
@@ -37,7 +137,6 @@ metadata:
|
|
37
137
|
homepage_uri: https://github.com/firstdraft/openai-chat
|
38
138
|
source_code_uri: https://github.com/firstdraft/openai-chat
|
39
139
|
changelog_uri: https://github.com/firstdraft/openai-chat/blob/main/CHANGELOG.md
|
40
|
-
post_install_message:
|
41
140
|
rdoc_options: []
|
42
141
|
require_paths:
|
43
142
|
- lib
|
@@ -52,8 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
151
|
- !ruby/object:Gem::Version
|
53
152
|
version: '0'
|
54
153
|
requirements: []
|
55
|
-
rubygems_version: 3.
|
56
|
-
signing_key:
|
154
|
+
rubygems_version: 3.6.5
|
57
155
|
specification_version: 4
|
58
156
|
summary: This gem provides a class called `OpenAI::Chat` that is intended to make
|
59
157
|
it as easy as possible to use OpenAI's Chat Completions endpoint.
|