yaroslavyaroslav / OpenAI-sublime-text

First class Sublime Text AI assistant with GPT-4o and llama.cpp support!
MIT License
130 stars 11 forks source link

OpenAi Ollama response is empty #43

Closed vjeantet closed 4 months ago

vjeantet commented 4 months ago

Hello, all delta chunks received from OpenAi/ollama have content and role attributes, so because of the elseif in handle_sse_delta( the content is never processed to update the output panel.

When you change elif to ìf` it works.

https://github.com/yaroslavyaroslav/OpenAI-sublime-text/blob/2c838c82a3d4037e7555d01189ef65c41cdf45d4/openai_worker.py#L63

yaroslavyaroslav commented 4 months ago

I'm pretty sure that this is just olama specific case, because I've tested it with OpenAI responses and they're working fine.

But anyway let me check if it isn't breaking anything in the main OpenAI's workflow and if it's not, I'll apply this fixup for olama for sure.