Building Your First Morph App
As your first AI app using Morph, we will create a chat app using Langchain.This tutorial requires an OpenAI API key. To obtain an API key, please visit the OpenAI website.
1
Initialize the Project
Run the following command in the terminal to create a new project.
2
Install Packages
To use Langchain, run the following command to install the package.
3
Create chat.py
Create a
chat.py file in the src/python directory.src/python/chat.py
4
Edit index.mdx
Edit
index.mdx to use the Python function created earlier.src/pages/index.mdx
5
Add API key to .env
Add your OpenAI API key to the
.env file..env
6
Start the Local Server
Run the following command in the terminal to start the development server.Access
localhost:8080 to open the app.