Class: Ollama::Transport::Request

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



8
9
10
# File 'lib/ollama/transport/request.rb', line 8

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



8
9
10
# File 'lib/ollama/transport/request.rb', line 8

def headers
  @headers
end

#methodObject (readonly)

Returns the value of attribute method.



8
9
10
# File 'lib/ollama/transport/request.rb', line 8

def method
  @method
end

#streamObject (readonly)

Returns the value of attribute stream.



8
9
10
# File 'lib/ollama/transport/request.rb', line 8

def stream
  @stream
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



8
9
10
# File 'lib/ollama/transport/request.rb', line 8

def timeout
  @timeout
end

#uriObject (readonly)

Returns the value of attribute uri.



8
9
10
# File 'lib/ollama/transport/request.rb', line 8

def uri
  @uri
end