This sample is an endpoint that tells programming jokes and shows how to deploy a flask app that uses Langchain on to AWS via Defang.
- Download Defang CLI
- (Optional) If you are using Defang BYOC authenticated with your AWS account
- (Optional - for local development) Docker CLI
- Open the terminal and type
defang login
- Set the environment variable
OPENAI_KEY
by typingdefang config set OPENAI_KEY
. - Type
defang compose up
in the CLI. - Your app will be running within a few minutes.
For development, first clone the project and navigate to its directory. After such, please run the command
docker compose up --build
This will start a Docker container with the flask app which will display the result of the langchain prompt.
Title: LangChain & Flask
Short Description: A sample project demonstrating how to deploy LangChain with Flask on Defang.
Tags: LangChain, Flask, AI, Python
Languages: python