How to poll or stream OpenAI Assistants API v2 response in Python & Node.js TUI🔥 — OpenAI #7

Описание к видео How to poll or stream OpenAI Assistants API v2 response in Python & Node.js TUI🔥 — OpenAI #7

💸 Become a beta tester for my "From 0 to OpenAI API hero" course! Enjoy the already discounted rate of just 15€ (50% off the original price) in exchange for your valuable feedback. 👉 https://rok-benko-s-school.teachable....

In today’s tutorial, we're going to learn how to get the assistant answer using the OpenAI Assistants API v2. There are two ways: response polling and response streaming. I’ll show you examples of both in both Python and Node.js.

⭐ Code ⭐
GitHub repository: https://github.com/rokbenko/ai-playgr...
Code for this tutorial: https://github.com/rokbenko/ai-playgr...

🙌 Support 🙌
If you would like to support me, subscribe to my YouTube channel (    / @rokbenko   ). Don't forget to click the bell 🔔 to get a notification when I release a new video.

📫 Contact 📫
GitHub: https://github.com/rokbenko
StackOverflow: https://stackoverflow.com/users/10347...
LinkedIn:   / rokbenko  
X: https://x.com/rokbenko

🎞️ Timestamps 🎞️
00:00 – Intro
00:14 – Code for this tutorial
00:28 – Response polling and response streaming explained
00:57 – Tutorial overview
01:48 – Code breakdown (part 1)
01:57 – Create an .env file to set up environment variables
02:14 – Code breakdown (part 2)
03:17 – Step 1: Create a new thread
03:24 – Step 2: Get the user question and display it
03:30 – Step 3: Add the user question to the thread messages
03:47 – Core of this tutorial
04:04 – Manual response polling example – Step 4: Run the assistant
04:10 – Manual response polling example – Step 5: Periodically retrieve the run to check its status
04:32 – Manual response polling example – Step 6: Display the assistant answer once the run is completed
04:48 – Response polling using a helper example – Step 4: Run the assistant and periodically retrieve the run to check its status using a helper
05:21 – Response polling using a helper example – Step 5: Display the assistant answer once the run is completed
05:29 – Response streaming using a helper example – Step 4: Run the assistant and stream its answer
06:00 – Code comparison
06:24 – Run the Python manual response polling example
06:57 – Run the Python response polling using a helper example
07:23 – Run the Python response streaming using a helper example
07:57 – Outro

#AI #OpenAI #AssistantsAPI

Комментарии

Информация по комментариям в разработке