Class: Llmclt::Request::Base
- Inherits:
-
Object
- Object
- Llmclt::Request::Base
show all
- Defined in:
- lib/llmclt/request/base.rb
Instance Method Summary
collapse
Constructor Details
#initialize(headers, config, **kwargs) ⇒ Base
Returns a new instance of Base.
6
7
8
9
10
|
# File 'lib/llmclt/request/base.rb', line 6
def initialize(, config, **kwargs)
@headers =
@config = config
kwargs.each { |k, v| instance_variable_set(:"@#{k}", v) }
end
|
Instance Method Details
#build_response(response) ⇒ Object
25
26
27
|
# File 'lib/llmclt/request/base.rb', line 25
def build_response(response)
raise NotImplementedError, "#{class_name}#{__method__} is not implemented"
end
|
#content ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'lib/llmclt/request/base.rb', line 16
def content
request = Net::HTTP::Post.new(endpoint_uri.request_uri)
@headers.each do |key, value|
request[key] = value
end
request.body = build_request_json
request
end
|
#endpoint_uri ⇒ Object
12
13
14
|
# File 'lib/llmclt/request/base.rb', line 12
def endpoint_uri
raise NotImplementedError, "#{class_name}#{__method__} is not implemented"
end
|