Class: LLM::Transport::Response
- Inherits:
-
Object
- Object
- LLM::Transport::Response
- Defined in:
- lib/llm/transport/response.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.
Direct Known Subclasses
Defined Under Namespace
Classes: HTTP
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?
52 53 54 |
# File 'lib/llm/transport/response.rb', line 52 def [](key) raise NotImplementedError end |
#bad_request? ⇒ Boolean
78 79 80 |
# File 'lib/llm/transport/response.rb', line 78 def bad_request? raise NotImplementedError end |
#body ⇒ Object
38 39 40 |
# File 'lib/llm/transport/response.rb', line 38 def body raise NotImplementedError end |
#body=(value) ⇒ Object
45 46 47 |
# File 'lib/llm/transport/response.rb', line 45 def body=(value) raise NotImplementedError end |
#code ⇒ String
32 33 34 |
# File 'lib/llm/transport/response.rb', line 32 def code raise NotImplementedError end |
#forbidden? ⇒ Boolean
90 91 92 |
# File 'lib/llm/transport/response.rb', line 90 def forbidden? raise NotImplementedError end |
#not_found? ⇒ Boolean
96 97 98 |
# File 'lib/llm/transport/response.rb', line 96 def not_found? raise NotImplementedError end |
#ok? ⇒ Boolean
72 73 74 |
# File 'lib/llm/transport/response.rb', line 72 def ok? raise NotImplementedError end |
#rate_limited? ⇒ Boolean
102 103 104 |
# File 'lib/llm/transport/response.rb', line 102 def rate_limited? raise NotImplementedError end |
#read_body(dest = nil) {|chunk| ... } ⇒ void
This method returns an undefined value.
60 61 62 |
# File 'lib/llm/transport/response.rb', line 60 def read_body(dest = nil, &) raise NotImplementedError end |
#server_error? ⇒ Boolean
108 109 110 |
# File 'lib/llm/transport/response.rb', line 108 def server_error? raise NotImplementedError end |
#success? ⇒ Boolean
66 67 68 |
# File 'lib/llm/transport/response.rb', line 66 def success? raise NotImplementedError end |
#unauthorized? ⇒ Boolean
84 85 86 |
# File 'lib/llm/transport/response.rb', line 84 def raise NotImplementedError end |