Replies: 2 comments
-
Here we have a problem, if we are going to support non-OpenAI APIs then we will have to rename the library to simple-non-openai. Well, ironies aside, I don't think it's a good idea to go that route. Simple-OpenAI was created to support the OpenAI API and we went further when we extended it to support OpenAI compatible APIs and that was fine. Moreover, your proposal would be going against the current trend, because most LLM vendors are working on exposing their APIs to be OpenAI compatible. Maybe you are having trouble with the latest Gemini Vertex integration? Please let me know if that's the case and we could find a creative approach without warping the essence of simple-openai. In the past, I thought about a general library to handle any API and created Jamaica, but with my limited time I couldn't work on it any further and decided to focus on simple-openai. |
Beta Was this translation helpful? Give feedback.
-
I understand you point of view. Let me just list a few points:
Anyway, I just wanted to raise the idea. I have no immediate need. No problems with the Gemini Vertex integration. |
Beta Was this translation helpful? Give feedback.
-
simple-openai at its core supports very strictly the official OpenAI API, including its endpoints and its semantics (assumes a stable base URL + API key). It also supports multiple non-OpenAI providers that provide OpenAI-compatible API. Some of these providers have different endpoint URLs (besides the base URL) or otherwise behave differently. Some of them even have bugs like Gemini.
simple-openai provides request and response interceptors that allow a provider implementation to modify the request and/or the response and allow simple-openai to operate smoothly with these slight variation from the formal supported OpenAI API + behavior.
But, we can theoretically take it further and support completely non-OpenAI APIs too. As long as conceptually the input and output of a particular API have some OpenAI equivalent then it should be possible to take an OpenAI request object sent to simple-openai modify the request to comply with some non-OpenAI API request, send it to that API and then on the way back modify the non-OpenAI response to an OpenAI-compatible JSON that will be serialized by simple-openai to its response object.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions