Open sheng-di opened 3 months ago
The package is made to reflect the OpenAI APIs, which I take to be my responsibility on this project.
rather than having this built in, have a custom proxying of the stream of completion, the map()
on a dart Stream
is what you need here to make the original response adapt to GPT proxies.
Hello @anasfik,
Firstly, I want to express my appreciation for your work on the 'openai' project. It's been incredibly useful and well implemented.
I am writing to suggest a feature that could enhance the adaptability of the project with different GPT proxies. Currently, the 'messages' field in the request body is an array of objects, each containing 'type' and 'text' fields, like so:
However, some GPT proxies only support strings and not objects. Therefore, it would be beneficial if we could have an option to set a parameter that changes the 'messages' field to only contain strings. For example, by setting OpenAI.onlyString = true;, the 'messages' content would be transformed into:
Implementing this feature would increase the project's compatibility with various GPT proxies, making it more versatile and user-friendly. I believe this would be a valuable addition to the project.
Thank you for considering this suggestion. I look forward to your feedback.