dvcrn / ex_openai

Auto-generated Elixir SDK for OpenAI APIs with full typespecs, docs and streaming support
MIT License
70 stars 26 forks source link

Jason decode errors while streaming assistants API #23

Open thiagomajesk opened 1 month ago

thiagomajesk commented 1 month ago

Hi! I'm getting the following Jason decoded errors while streaming using the assistant API. The example is pretty much the same as the Streaming with a callback function section, but using ExOpenAI.Threads.create_thread_and_run/2 instead.

Error: %Jason.DecodeError{position: 491, token: nil, ...}
Error: %Jason.DecodeError{position: 0, token: nil, ...}

It seems that both V1 and V2 APIs are not working, while V2 is the only one that goes through and returns the errors.

dvcrn commented 1 month ago

Thanks for reporting! Let me try to look into this when I'm with a bit more time