Skip to content

data-science-nerds/fastapi-langchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastapi-langchain

Showcase pydantic, fastapi, langchain, openai

live web app running on: http://54.198.111.198:8080/static/index.html

we use pydantic to validate:

  • all rows going into pinecone have data
  • all pinecone data cites a valid https link
  • the validation is done before the upsert
  • the data used here was validated in scripts/pydantic_validation_langchain_retrieval_augmentation.ipynb
    • they were only done once for upserting because once it is validated as a dataset before going into pinecone, we dont need to validate before upserting it again
    • we would validate again if we were refreshing our pinecone embeddings with new data

to run inside ec2 for demo purposes (if production would use nginx): uvicorn backend.api.main:app --host 0.0.0.0 --port 8080

file structure

fastapi-langchain/
│ ├── backend/ │ ├── data/ │ │ └── processed/ │ │ └── documents/ │ │ └── parquet_df_with_metadata.parquet │ │ │ ├── scripts/ │ │ ├── live_LLM.py │ │ ├── ... [other scripts] │ │ │ ├── api/ │ │ ├── main.py # FastAPI main application file │ │ ├── models/ # Pydantic models, if any │ │ └── routers/ # Separate FastAPI routers, if you want to modularize endpoints │ │ │ └── .env # Contains environment variables │ ├── frontend/ │ └── requirements.txt

About

Showcase pydantic, fastapi, langchain, openai

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published