Closed AyushSawant18588 closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.04%. Comparing base (
774fc9d
) to head (9caa8d3
). Report is 61 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@sashabaranov Can you please look into this?
Describe the change When the inference engine returns an error response that is not of type openai.ErrorResponse, a decode error occurs, leading to the loss of the original error message from the inference engine. To address this issue, this PR implements a change in the go-openai client that ensures the error from the inference engine is included in the openai.RequestError response. This enhancement preserves the original error information, providing clearer insights into the underlying issues.
Describe your solution Introduced a new field called Body of type []byte in the openai.RequestError struct. This field stores the byte slice of the error response body received from the inference engine when the error response does not conform to the openai.ErrorResponse type. This enhancement allows to retain the original error message. Now that the byte slice of the error response body is included, clients using this library can unmarshal it on their end to obtain the correct error message.
Issue: https://github.com/sashabaranov/go-openai/issues/874