How to Stream OpenAI API Responses in a Flask App

Поділитися
Вставка
  • Опубліковано 25 сер 2024
  • In this video I'll demonstrate how to stream OpenAI API responses in your Flask apps using JavaScript.
    Need one-on-one help with your project? I can help through my coaching program. Learn more here: prettyprinted....
    Get the code here: prettyprinted....
    Github: github.com/pre...
    Twitter: / pretty_printed

КОМЕНТАРІ • 23

  • @heronfree7374
    @heronfree7374 4 місяці тому +1

    You are a life saver with this video. Was looking for how to stream like this forever. Thanks so much!

  • @heronfree7374
    @heronfree7374 4 місяці тому +5

    Thanks!

  • @WayneBruton
    @WayneBruton 4 місяці тому +1

    Great video, would love to see one using the new streaming with the assistants api

    • @prettyprinted
      @prettyprinted  4 місяці тому

      I'll look into that and I'll see what I can do. My next video should also be an OpenAI API video.

  • @jamiewise2489
    @jamiewise2489 14 днів тому

    Very helpful video!
    I have found that when I stream output, the translation from markdown to HTML is sometimes applied incorrectly on list items (especially nested and ordered ones). I think that this could be due to some chunks lacking the full context needed for the HTML tags to be applied correctly. Do you have any ideas/ways to approach handling this?

  • @tushaar9027
    @tushaar9027 3 місяці тому

    Thanks bro,.....it really helped .....I was looking for implementation with flask..pls make another video on how to use these streaming api in python backend code with request module as well

  • @enriquebruzual1702
    @enriquebruzual1702 5 місяців тому +2

    What an opportunity for HTMX

    • @prettyprinted
      @prettyprinted  4 місяці тому

      Yup, HTMX would work well with this. Thanks for watching!

  • @ashishkingdom
    @ashishkingdom 5 місяців тому

    Cool!! I couldn't get this working in FastAPI

  • @pythonantole9892
    @pythonantole9892 5 місяців тому

    Good example for an HTMX use case.

    • @prettyprinted
      @prettyprinted  4 місяці тому

      I'll consider using HTMX for this in a video. Thanks for watching!

  • @-ankit198
    @-ankit198 5 місяців тому

    I love your videos !! Can you make the same tutorial in node.js through I work in both flask and node.js but would really love to learn it in node !!

    • @prettyprinted
      @prettyprinted  4 місяці тому

      If I made more videos, I'd definitely do a Node version, but given my output these days, it's more likely to be either Django or FastAPI. Thanks for watching though!

  • @josklijnhout1660
    @josklijnhout1660 2 місяці тому

    Hi Great video, do already have it working for the assistent api, because my heads exploding. maybe you know. I have it in react, but want it in flask java

  • @andreialuculesei1842
    @andreialuculesei1842 5 місяців тому

    May you make a video where we can do an api using async ?

    • @prettyprinted
      @prettyprinted  4 місяці тому

      Do you mean this library with async? I don't think the streaming would well with an async approach (assuming your goal is to call the API multiple times)

  • @rangabharath4253
    @rangabharath4253 5 місяців тому

    Awesome

  • @abdulnafihkt4245
    @abdulnafihkt4245 4 місяці тому

    Can you do how to set up rabitmq on flask

    • @prettyprinted
      @prettyprinted  4 місяці тому +1

      I'll consider that as a video. Thanks for watching!

  • @AliMughrabi
    @AliMughrabi 5 місяців тому