Class: Ollama::Transport::Request
- Inherits:
-
Object
- Object
- Ollama::Transport::Request
- Defined in:
- lib/ollama/transport/request.rb
Overview
Transport-level request value object. Decouples serialization from the underlying network transport library.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(method:, uri:, headers: {}, body: nil, stream: false, timeout: 120) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(method:, uri:, headers: {}, body: nil, stream: false, timeout: 120) ⇒ Request
Returns a new instance of Request.
10 11 12 13 14 15 16 17 |
# File 'lib/ollama/transport/request.rb', line 10 def initialize(method:, uri:, headers: {}, body: nil, stream: false, timeout: 120) @method = method.to_sym @uri = uri @headers = headers @body = body @stream = stream @timeout = timeout end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
8 9 10 |
# File 'lib/ollama/transport/request.rb', line 8 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
8 9 10 |
# File 'lib/ollama/transport/request.rb', line 8 def headers @headers end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
8 9 10 |
# File 'lib/ollama/transport/request.rb', line 8 def method @method end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
8 9 10 |
# File 'lib/ollama/transport/request.rb', line 8 def stream @stream end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
8 9 10 |
# File 'lib/ollama/transport/request.rb', line 8 def timeout @timeout end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
8 9 10 |
# File 'lib/ollama/transport/request.rb', line 8 def uri @uri end |