π€Ask questions to iPad product in natural language based on NotionDBπ€
πͺ Built with LangChain
In order to set your environment up to run the code here, first install all requirements:
pip install -r requirements.txt
Then set your OpenAI API key. OpenAI API should work only if you set your paid payment methods.
export OPENAI_API_KEY=....
This repo uses the iPad Technical Specification Product created on May, 08 2023/
In order to ask a question, run a command like:
python qa.py `What is iPad?`
You can switch out What is iPad?
for any question of your like, such as What is the lates iPad version?
The code to run the StreamLit app is in main.py
.
add this code before load the chain section in the main.py
file before deploy it to streamlit.
openai.api_key=st.secrets["api"]
replace chain variable with these one:
chain = VectorDBQAWithSourcesChain.from_llm(llm=OpenAI(temperature=0, openai_api_key=openai.api_key), vectorstore=store)