For those asking for the code, it's hard for me to share the repo since it's built on top of a proprietary product (SaaS Pegasus), but here is a Git patch file of the diffs for the entire video, which should help you apply it to your own Django projects. In addition to this diff you will need to set up a Django project and set up Channels. The full code is also now available in Pegasus. gist.github.com/czue/fc37f732f5c70cd16f38819d399b129f
Thanks. Yeah, it should likely be async. It was ported from a more complex example with ORM access and other things that ended up being more trouble than it was worth to troubleshoot and I forgot to swap it back. Hopefully the concepts are helpful even with that oversight. I think most of the value for people and emphasis is on the front end side which doesn't change.
@@GBOAC i mean, the client is just a python object that makes web requests. i don't think there's any setup code or anything. and yes it's async compatible.
For those asking for the code, it's hard for me to share the repo since it's built on top of a proprietary product (SaaS Pegasus), but here is a Git patch file of the diffs for the entire video, which should help you apply it to your own Django projects. In addition to this diff you will need to set up a Django project and set up Channels. The full code is also now available in Pegasus.
gist.github.com/czue/fc37f732f5c70cd16f38819d399b129f
You sir are a hero! You literally taught me so many things that I was stuck of months!!
Very nice, I will use this as a reference for my future hobby project.
Good video, keep it up!
This looks great! Great to see a practical example for web sockets with HTMX and Django Channels!
great video, thanks. I would also be very interested in the repo
See pinned comment.
can you share the repo?
See pinned comment
Great video. Is there a repo you could share ?
See pinned comment
This is not async. When would you ever use a chatbot that is not async, doesn't that block the event loop ... ?
Let alone instantiate a client per incoming request
Thanks. Yeah, it should likely be async. It was ported from a more complex example with ORM access and other things that ended up being more trouble than it was worth to troubleshoot and I forgot to swap it back. Hopefully the concepts are helpful even with that oversight. I think most of the value for people and emphasis is on the front end side which doesn't change.
@@GBOAC Can you elaborate on this? Are you referring to the OpenAI client? Pretty sure that's a negligible performance operation.
@@czue for a few users maybe but this doesn’t scale obviously. And is the client async compatible anyway?
@@GBOAC i mean, the client is just a python object that makes web requests. i don't think there's any setup code or anything. and yes it's async compatible.