File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -600,11 +600,13 @@ class << self
600600 #
601601 # @return [Object]
602602 def encode_content ( headers , body )
603+ # rubocop:disable Style/CaseEquality
604+ # rubocop:disable Layout/LineLength
603605 content_type = headers [ "content-type" ]
604606 case [ content_type , body ]
605607 in [ OpenAI ::Internal ::Util ::JSON_CONTENT , Hash | Array | -> { primitive? ( _1 ) } ]
606608 [ headers , JSON . generate ( body ) ]
607- in [ OpenAI ::Internal ::Util ::JSONL_CONTENT , Enumerable ] unless body . is_a? ( OpenAI ::Internal ::Type ::FileInput )
609+ in [ OpenAI ::Internal ::Util ::JSONL_CONTENT , Enumerable ] unless OpenAI ::Internal ::Type ::FileInput === body
608610 [ headers , body . lazy . map { JSON . generate ( _1 ) } ]
609611 in [ %r{^multipart/form-data} , Hash | OpenAI ::Internal ::Type ::FileInput ]
610612 boundary , strio = encode_multipart_streaming ( body )
@@ -619,6 +621,8 @@ def encode_content(headers, body)
619621 else
620622 [ headers , body ]
621623 end
624+ # rubocop:enable Layout/LineLength
625+ # rubocop:enable Style/CaseEquality
622626 end
623627
624628 # @api private
You can’t perform that action at this time.
0 commit comments