Psychic LangChain tutorial
This is the code for the How to use LangChain and Psychic to answer questions about your documents with AI tutorial. There are two ways to run this app.
Psychic is a data integration platform for LLM applications. Learn more by reading the Psychic Docs.
Python notebook
psychic_notebook.ipynb
is a Python notebook, which makes it easy to play around with the functionality without cloning this repo. Run it with Google Colab or Jupyter Notebook or just copy the hosted version here
API Server
server.py
contains the code for setting up a HTTP server that can respond to queries about content connected through the Psychic Notion connector.
Setup
- Follow instructions in
.env
to configure the environment variables - Install Poetry, if you don't already have it
- Run the following commands
poetry install poetry shell uvicorn main:app --reload
- Test out your new API endpiont by sending a
GET
request tohttp://127.0.0.1:8000/get_answer
with the following body:{ "query": "YOUR QUESTION" }
- Deploy with your favorite cloud hosting provider.