Class: LLM::Multipart
- Inherits:
-
Object
- Object
- LLM::Multipart
- Defined in:
- lib/llm/multipart.rb,
lib/llm/multipart/enumerator_io.rb
Defined Under Namespace
Classes: EnumeratorIO
Constant Summary collapse
- CHUNK_SIZE =
16 * 1024
Instance Attribute Summary collapse
- #boundary ⇒ String readonly
Instance Method Summary collapse
-
#body ⇒ LLM::Multipart::EnumeratorIO
Returns the multipart request body as a stream.
-
#content_type ⇒ String
Returns the multipart content type.
- #initialize(params) ⇒ LLM::Multipart constructor
Constructor Details
#initialize(params) ⇒ LLM::Multipart
19 20 21 22 |
# File 'lib/llm/multipart.rb', line 19 def initialize(params) @boundary = "BOUNDARY__#{SecureRandom.hex(16)}" @params = params end |
Instance Attribute Details
#boundary ⇒ String (readonly)
13 14 15 |
# File 'lib/llm/multipart.rb', line 13 def boundary @boundary end |
Instance Method Details
#body ⇒ LLM::Multipart::EnumeratorIO
Returns the multipart request body as a stream
34 35 36 |
# File 'lib/llm/multipart.rb', line 34 def body LLM::Multipart::EnumeratorIO.new(enum_for(:each_part)) end |
#content_type ⇒ String
Returns the multipart content type
27 28 29 |
# File 'lib/llm/multipart.rb', line 27 def content_type "multipart/form-data; boundary=#{@boundary}" end |