From the course: Level up LLM applications development with LangChain and OpenAI
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Create the routes and the endpoints
From the course: Level up LLM applications development with LangChain and OpenAI
Create the routes and the endpoints
- [Instructor] The next step is to create the routes and endpoints. So let's do that with this built-in method, which is add_routes. And we're going to use, actually, like a similar example, which uses the ChatOpenAI model. So let's use the same, I'm going to copy these lines and then paste it here. And just so it is less verbose, we're going to keep it simple. So first, we access the server to create the route, and we specify the path, which will be OpenAI. And just for the next demonstration, we're going to also allow to run the server here with Uvicorn. So let's set this up. I'm going to copy these lines, and add it exactly right here. And I'm going to go find instruction as to how to start and run the server. So of course, we have installed correctly here, langserve, and also Uvicorn. So as a reminder, Uvicorn is a web server implementation for Python. And so to use it, we're going to simply run this way, Uvicorn server:app, and then reload. Reload is in the case that you make a…
Contents
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Introducing LangServe: Installation and setup3m 35s
-
(Locked)
Create a server49s
-
(Locked)
Create the routes and the endpoints5m 56s
-
(Locked)
Create a runnable to combine a prompt, a model, and output3m 35s
-
(Locked)
Challenge: Deploy a RESTful API1m 39s
-
(Locked)
Solution: Deploy a RESTful API2m 51s
-
(Locked)
-
-