Module: OpenAI::ResponseCarrier
- Defined in:
- lib/openai/response_carrier.rb,
sig/openai/response_carrier.rbs
Overview
Shared response metadata interface for SDK values that are not model objects, such as binary StringIO responses.
Instance Attribute Summary collapse
-
#last_response ⇒ OpenAI::ResponseMetadata?
readonly
Metadata from the HTTP response that produced this value.
Instance Method Summary collapse
-
#_request_id ⇒ String?
The ID of the API request, returned via the x-request-id response header.
- #_set_last_response(response) ⇒ self private
-
#encode_with(_coder) ⇒ void
private
Keep transport metadata outside Psych's object serialization path.
Instance Attribute Details
#last_response ⇒ OpenAI::ResponseMetadata? (readonly)
Metadata from the HTTP response that produced this value.
21 22 23 |
# File 'lib/openai/response_carrier.rb', line 21 def last_response @last_response end |
Instance Method Details
#_request_id ⇒ String?
The ID of the API request, returned via the x-request-id response header. This is only populated on top-level response objects returned by the client.
14 |
# File 'lib/openai/response_carrier.rb', line 14 def _request_id = last_response&.request_id |
#_set_last_response(response) ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 30 |
# File 'lib/openai/response_carrier.rb', line 27 def _set_last_response(response) @last_response = response self end |
#encode_with(_coder) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Keep transport metadata outside Psych's object serialization path.
38 39 40 |
# File 'lib/openai/response_carrier.rb', line 38 def encode_with(_coder) nil end |