Chatbot with Ruby on Rails, Turbo Streams, and OpenAI

  Рет қаралды 3,022

CJ Avilla

CJ Avilla

Күн бұрын

In this episode, we build a chatbot in Ruby on Rails using Turbo Streams to create a real-time chat experience.
00:00 - Introduction
We generate a Chat controller, model, and migrations to get started. Then we create the main chat index and show pages.
02:35 - Implement Chat Messaging
We build out sending and displaying chat messages using Turbo Streams to update the page without reloading. We also add a background job to process the chat messages.
05:30 - Integrate OpenAI API
We send the chat message history to the OpenAI API to generate responses. Then we display the "thinking" message before replacing it with the actual response via Turbo Streams.
09:10 - Refactor for Live Feedback
We refactor the OpenAI job to immediately show the "thinking" message, then later replace it with the final response. This provides live feedback as the response is generated.
12:30 - Next Steps
Some ideas for future improvements like authentication, fine-tuning an AI model, and streaming the OpenAI response.
Overall, we build a real-time chatbot with Rails and OpenAI using Turbo Streams for a smooth user experience. The code is available on GitHub to try it out yourself!
#rubyonrails #openai

Пікірлер: 10
@dfriis
@dfriis 6 ай бұрын
Thank you so much for sharing. Love your content. Especially love that you allow for errors in your videos. It's super helpful to see how you debug 🙏
@YoussefGazzar
@YoussefGazzar 7 ай бұрын
I was afraid of another hiatus but thank God I was wrong! Always happy to receive a new video notification from your channel, keep going bro ❤
@cjav_dev
@cjav_dev 7 ай бұрын
Thank you! 🙌
@badta5te
@badta5te 7 ай бұрын
A few weeks ago, I did something similar, but it was a bit messier. Now it's time to refactor. Thank you!
@55BLOCKS
@55BLOCKS 6 ай бұрын
Good content, Mike from kenya
@tolaseadegbite1027
@tolaseadegbite1027 7 ай бұрын
Welcome back CJ
@abdullahsaleh7196
@abdullahsaleh7196 2 ай бұрын
keep going
@doasido5757
@doasido5757 7 ай бұрын
Do you have a video on how to connect the “Woo My accounts” with the “Stripe connect card holders” so that my customers can see there account balance in the same location as the dashboard on Woo My account? Thank you
@piotrekdabrowski7516
@piotrekdabrowski7516 Ай бұрын
Is there any github with code?
@Adnankhan-dr7qn
@Adnankhan-dr7qn 6 ай бұрын
Thank you so much and can you give us a source code please ?
Realtime partial page updates with Turbo Streams
22:33
CJ Avilla
Рет қаралды 9 М.
В ДЕТСТВЕ СТРОИШЬ ДОМ ПОД СТОЛОМ
00:17
SIDELNIKOVVV
Рет қаралды 2,6 МЛН
Is it Cake or Fake ? 🍰
00:53
A4
Рет қаралды 12 МЛН
Schunk Automation Solutions at Automate 2024
6:01
Elite Automation
Рет қаралды 16
How to use the Make (formerly Integromat) Webhook - Tutorial 2023
10:17
TechflowAI - Producing Time
Рет қаралды 18 М.
Build Your Own ChatGPT with Ruby on Rails 7 and OpenAI API
4:29
Rails vs JavaScript: Which one should you use for your SaaS?
12:50
Introduction to Hotwire in Ruby on Rails
10:17
Mix & Go
Рет қаралды 19 М.
The Ruby On Rails Junior Developer Problem
16:03
Deanin
Рет қаралды 18 М.
Rails 7.1 Authentication From Scratch
44:31
GoRails
Рет қаралды 16 М.
Vous préférez quand je ferme mon clapet c’est ça! 😠😂
1:01
Hack de Vie
Рет қаралды 25 МЛН
Cute 💞😋🍭🍦
0:10
Tuğkan Efe
Рет қаралды 4,9 МЛН
Самая высокая малышка в мире 😳
0:39
УГОЛ СМЕХА
Рет қаралды 7 МЛН
Camry rear hub replaced #carpart
0:36
Inayat auto technician
Рет қаралды 7 МЛН
2000000❤️⚽️#shorts #thankyou
0:20
あしざるFC
Рет қаралды 7 МЛН