The database is not automatically stored when streaming response
response1 = openai_client.chat.completions.create( model="xxx", stream=True, messages=[{"role": "user", "content": "I'm working on a Python FastAPI project"}], ) like this, the sqlite database does not store dialogs
@tianqihou Thanks for raising this! Currently, streamed responses aren’t recorded in Memori, but support for this is planned for an upcoming update.
I'm confused about how the streaming output of LiteLLM can be stored in Memori. How is this implemented?
Hi @tianqihou , Memori uses LiteLLM's success_callback system. When streaming completes, LiteLLM automatically calls our callback with the reconstructed full conversation (input + complete output), which Memori then stores in SQL Custom Callbacks | liteLLM. The callback gets registered automatically when you call memori.enable(). Thanks!
Thank you. I really like this pluggable memory approach. I hope this project becomes more and more popular.
Thank you! Really appreciate the support. 🙏 Feel free to star the repo and share it if you find it useful. Community feedback like yours helps drive the project forward!
Hello @harshalmore31 , I've created a PR to support streaming responses from LiteLLM in #169 . Could you please take a look at it?
Thank you!