Creating an OpenAI Service | #11 Building an App with Effect
Автор: Lucas Barake
Загружено: 2025-08-14
Просмотров: 816
👉 Enroll to Practical Effect here: https://lucasbarake.com/
Buy me a coffee! https://buymeacoffee.com/lucasbarake
Repo: https://github.com/lucas-barake/build...
In this video, we build a foundational, type-safe AI service from scratch using Effect TS. We start by designing a core AI model interface that's provider-agnostic, allowing for future integrations with services beyond just OpenAI.
We then proceed to build the first implementation for this service using the OpenAI API. This involves creating a dedicated provider to handle configuration and constructing a resilient HTTP client with built-in retries. The video walks through the implementation of three key methods: generating plain text, generating structured JSON objects using Effect Schema, and streaming responses in real-time.
The tutorial concludes with a live test to demonstrate that all three functions—text, object, and stream—are working correctly.
00:00:00 - Why Build a Custom AI Service?
00:00:30 - Defining the Core AI Model Interface
00:01:56 - Designing the Service Methods
00:02:55 - Creating a Custom Error Type
00:05:07 - Setting up the OpenAI Provider
00:06:44 - Building the HTTP Client
00:08:39 - Creating the Provider Layer
00:10:01 - Scaffolding the OpenAI Model Implementation
00:11:41 - Implementing generateText
00:14:42 - Implementing generateObject for Structured Output
00:17:03 - Implementing streamText with Server-Sent Events
00:20:55 - Live Demo: Testing Text, Object, and Stream
00:26:36 - Recap & What's Coming Next
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: