Replies: 3 comments
-
@sashirestela Looking at the code I see that there are many senders that extend HttpSender and oveeride the sendRequest() method. They all call at some point response.body(). For example:
It seems that it's possible to add the response interceptor as another argument to sendRequest, or add a constructor and instead of directly calling response.body() the sender can call Is the difficulty come from the fact that all the sender classes need to be touched? or is there some other issue I'm missing. The change itself seems simple and similar across all the classes. |
Beta Was this translation helpful? Give feedback.
-
@the-gigi On the other hand, I don't see a real value in implementing it now or giving it a high priority, considering that I am thinking of making several changes to this library to make it more efficient and have a wider scope of application. |
Beta Was this translation helpful? Give feedback.
-
The idea is similar to the request interceptor, which allows users to register a hook that can modify the request just before it is sent.
The motivation is a bug in the OpenAI compatibility of the Gemini API, which can be worked around by modifying the response coming back from Gemini.
See https://discuss.ai.google.dev/t/openai-compatibility-bug-in-response-object/58484
@sashirestela you mentioned in this simple-openai issue that I should open a cleverclient issue, but them said that it would be more difficult:
sashirestela/simple-openai#248 (comment)
So, instead of opening an issue I'm starting this discussion to understand the difficulty.
Beta Was this translation helpful? Give feedback.
All reactions