Skip to content

DefangSamples/sample-langchain-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Langchain & Flask

1-click-deploy

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.

Prerequisites

  1. Download Defang CLI
  2. (Optional) If you are using Defang BYOC authenticated with your AWS account
  3. (Optional - for local development) Docker CLI

Deploying

  1. Open the terminal and type defang login
  2. Set the environment variable OPENAI_KEY by typing defang config set OPENAI_KEY.
  3. Type defang compose up in the CLI.
  4. Your app will be running within a few minutes.

Development

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6