Create a FastAPI + Langchain Project in 5 Easy Steps: A Step-by-Step Guide
<p>At the end of these steps you will obtain a FastAPI + Langchain project with which you can add the functionalities you want, It will include an agent that has various tools available, all this without writing a line of code, since it will be generated by a FastAPI template script! This project uses <a href="https://github.com/allient/create-fastapi-project" rel="noopener ugc nofollow" target="_blank">create-fastapi-project</a> to start a sample project template.</p>
<h1>Requirements:</h1>
<ul>
<li>Docker</li>
</ul>
<h1>Template Folder Structure:</h1>
<pre>
.
├───backend
│ └───app
│ ├───app
│ │ ├───api
│ │ │ └───v1
│ │ │ └───endpoints
│ │ ├───core
│ │ ├───schemas
│ │ ├───templates
│ │ │ └───general_pages
│ │ └───utils
│ │ ├───adaptive_cards
│ │ └───exceptions
│ └───test
├───caddy
├───frontend
│ └───app
└───static</pre>
<h1>Containers <strong>Architecture</strong>:</h1>
<p><img alt="" src="https://miro.medium.com/v2/resize:fit:630/1*O7UptLeeHbFl57bz6Ab6aA.png" style="height:266px; width:700px" /></p>
<h1>Step 1: Download the Python script to execute the template generator</h1>
<pre>
pip install create-fastapi-project</pre>
<h1>Step 2: Execute the script</h1>
<pre>
create-fastapi-project</pre>
<h1>Step 3: Follow the CLI instructions</h1>
<p>In this step just put your project name and choose <strong>langchain_basic </strong>template</p>
<p><img alt="" src="https://miro.medium.com/v2/resize:fit:630/1*B-3lCS_-w8xO3SSgCToa5Q.gif" style="height:341px; width:700px" /></p>
<h1>Step 4: Set up enviroment variables</h1>
<p>To run this project you need to set almost the OPENAI_API_KEY because the agent is powered by OPENAI.</p>
<p><a href="https://medium.com/allient/create-a-fastapi-langchain-project-in-5-easy-steps-a-step-by-step-guide-ab467708fbb">Read More</a></p>