Class: LLM::Transport::Response
- Inherits:
-
Object
- Object
- LLM::Transport::Response
- Defined in:
- lib/llm/transport/response.rb,
lib/llm/transport/response/curb.rb,
lib/llm/transport/response/http.rb
Overview
LLM::Transport::Response defines the normalized HTTP response interface expected by transports and provider error handlers.
Custom transports can execute requests through any underlying HTTP client, then adapt that client’s native response object to this interface.
This keeps the transport boundary focused on one contract: providers, execution, and error handlers only need a response object that implements LLM::Transport::Response, regardless of how the request was actually performed.
Defined Under Namespace
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ String?
- #bad_request? ⇒ Boolean
- #body ⇒ Object
- #body=(value) ⇒ Object
- #code ⇒ String
- #forbidden? ⇒ Boolean
- #not_found? ⇒ Boolean
- #ok? ⇒ Boolean
- #rate_limited? ⇒ Boolean
- #read_body(dest = nil) {|chunk| ... } ⇒ void
- #server_error? ⇒ Boolean
- #success? ⇒ Boolean
- #unauthorized? ⇒ Boolean
Class Method Details
Instance Method Details
#[](key) ⇒ String?
53 54 55 |
# File 'lib/llm/transport/response.rb', line 53 def [](key) raise NotImplementedError end |
#bad_request? ⇒ Boolean
79 80 81 |
# File 'lib/llm/transport/response.rb', line 79 def bad_request? raise NotImplementedError end |
#body ⇒ Object
39 40 41 |
# File 'lib/llm/transport/response.rb', line 39 def body raise NotImplementedError end |
#body=(value) ⇒ Object
46 47 48 |
# File 'lib/llm/transport/response.rb', line 46 def body=(value) raise NotImplementedError end |
#code ⇒ String
33 34 35 |
# File 'lib/llm/transport/response.rb', line 33 def code raise NotImplementedError end |
#forbidden? ⇒ Boolean
91 92 93 |
# File 'lib/llm/transport/response.rb', line 91 def forbidden? raise NotImplementedError end |
#not_found? ⇒ Boolean
97 98 99 |
# File 'lib/llm/transport/response.rb', line 97 def not_found? raise NotImplementedError end |
#ok? ⇒ Boolean
73 74 75 |
# File 'lib/llm/transport/response.rb', line 73 def ok? raise NotImplementedError end |
#rate_limited? ⇒ Boolean
103 104 105 |
# File 'lib/llm/transport/response.rb', line 103 def rate_limited? raise NotImplementedError end |
#read_body(dest = nil) {|chunk| ... } ⇒ void
This method returns an undefined value.
61 62 63 |
# File 'lib/llm/transport/response.rb', line 61 def read_body(dest = nil, &) raise NotImplementedError end |
#server_error? ⇒ Boolean
109 110 111 |
# File 'lib/llm/transport/response.rb', line 109 def server_error? raise NotImplementedError end |
#success? ⇒ Boolean
67 68 69 |
# File 'lib/llm/transport/response.rb', line 67 def success? raise NotImplementedError end |
#unauthorized? ⇒ Boolean
85 86 87 |
# File 'lib/llm/transport/response.rb', line 85 def raise NotImplementedError end |