When using an openai compatible API (text-generation-webui) I kept getting no response in nvim, while it was being generated and received on the network. Upon inspecting the response I saw that all but the first message had \r\n\r\n at their ends. Looking at the code it seems that the carriage return gets removed for the first message with the headers, but not for subsequent messages. I think there's more to this, but I'm very new to Lua, so digging deeper is proving difficult.
When using an openai compatible API (text-generation-webui) I kept getting no response in nvim, while it was being generated and received on the network. Upon inspecting the response I saw that all but the first message had
\r\n\r\n
at their ends. Looking at the code it seems that the carriage return gets removed for the first message with the headers, but not for subsequent messages. I think there's more to this, but I'm very new to Lua, so digging deeper is proving difficult.