File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def self.to_json(string)
101
101
#
102
102
# @param user_proc [Proc] The proc to call for each JSON object in the chunk.
103
103
# @return [Proc] A proc that can be used to iterate over the JSON stream.
104
- private_class_method def self . to_json_stream ( user_proc :)
104
+ def self . to_json_stream ( user_proc :)
105
105
proc do |chunk , _ |
106
106
chunk . scan ( /(?:data|error): (\{ .*\} )/i ) . flatten . each do |data |
107
107
user_proc . call ( JSON . parse ( data ) )
Original file line number Diff line number Diff line change 28
28
describe ".to_json_stream" do
29
29
context "with a proc" do
30
30
let ( :user_proc ) { proc { |x | x } }
31
- let ( :stream ) { OpenAI ::Client . send ( : to_json_stream, user_proc : user_proc ) }
31
+ let ( :stream ) { OpenAI ::Client . to_json_stream ( user_proc : user_proc ) }
32
32
33
33
it "returns a proc" do
34
34
expect ( stream ) . to be_a ( Proc )
You can’t perform that action at this time.
0 commit comments