zhu327 / gemini-openai-proxy

A proxy for converting the OpenAI API protocol to the Google Gemini Pro protocol.
MIT License
504 stars 92 forks source link

Replied sometimes contain /n #18

Closed SwiftDev29 closed 5 months ago

SwiftDev29 commented 5 months ago

The gemini pro responses will randomly contain, /n sometimes instead of actually going to the next line. I suspect it’s similar to the previous issue of quotation marks getting printed.

zhu327 commented 5 months ago

Perhaps you can debug it, in case of similar situations, print out the request/response data

zhu327 commented 5 months ago

I think I've identified this issue. In Gemini, when streaming Markdown output, it occasionally gets interrupted. For example, in a reply like:

```Test stream text.\n this is look good for me.

You can see the Markdown tags starting with ```, but for some unknown reason, the streaming output gets interrupted. As a result, the closing tag for this text is missing, leading to the observed issue. If you encounter this problem, you can try regenerating it once. Currently, there is no other workaround.