Building AI App
Complete your first AI app in 3 minutes.
Building Your First Morph App
As your first AI app using Morph, we will create a chat app using Langchain.
If the Morph CLI setup is not complete, please refer to the Installation Documentation to install the CLI.
This tutorial requires an OpenAI API key. To obtain an API key, please visit the OpenAI website.
Initialize the Project
Run the following command in the terminal to create a new project.
Install Packages
To use Langchain, run the following command to install the package.
Create chat.py
Create a chat.py
file in the src/python
directory.
Edit index.mdx
Edit index.mdx
to use the Python function created earlier.
Add API key to .env
Add your OpenAI API key to the .env
file.
Start the Local Server
Run the following command in the terminal to start the development server.
Access localhost:8080
to open the app.
Here is all the code needed to build a simple chat app. That’s it!