Contents
Python 3 -> Additional Options -> 3.11-bullseye -> ZSH Plugins (Last One) -> Trust @devcontainers-contrib -> Keep Defaults
Install Python 3.11
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.11
Setup venv
:
python3.11 -m venv .venv
source .venv/bin/activate
Install requirements:
pip install --upgrade pip
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt --upgrade
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y libmagic-dev poppler-utils tesseract-ocr libreoffice pandoc
Install Cuda (optional):
sudo apt install nvidia-cuda-toolkit
Replace Your*
in the file .streamlit/secrets.dev.toml
with your own keys.
openai_api_key = "YourKey"
pinecone_api_key = "YourKey"
pinecone_environment = "YourENV"
pinecone_index = "YourIndex"
xata_api_key = "YourKey"
xata_db_url = "YourURL"
langchain_verbose = true
llm_model = "YourModel"
password = "YourKey"
Follow these steps to retrieve your OpenAI API key :
If you don't already have an account with OpenAI, you'll need to register for one.
Go to the Overview - OpenAI API. Enter your credentials to log in to your OpenAI account.
Step1: Once logged in, click on your account name in the upper right corner. In the dropdown menu, select "View API keys."
Step2: Create a New API key
Step3: Copy the API key
Step4: Paste it into your code as follows:
openai_api_key = "YourKey"
Follow these steps to retrieve your Pinecone API Key and Environment:
If you don't already have an account with Pinecone, you'll need to register for one.
Go to the Vector Database for Vector Search | Pinecone. Enter your credentials to log in to your Pinecone account.
Step1: Once logged in, select "API Keys" in the left corner. Then create a new API key by step1-3. You can also use the default API.
Step2: Copy the API key (Value) and Environment
Step3: Paste it into your code as follows:
pinecone_api_key = "YourKey"
pinecone_environment = "YourENV"
Step1: Create a New Index
Step2: Index Configuration
- Custom index name. Example: gpt.
- Select the index type and size. Dimensions: 1536. Metric cosine: cosine. Select your Pod Type: Default starter.
Step3: Paste Index Name into your code as follows:
pinecone_index = "YourIndex"
Follow these steps to retrieve your Xata API Key and Database URL:
You can use your GitHub or Google account to log in to Xata.
Step1: Once logged in, click on your account name in the upper right corner. In the dropdown menu, select "Account settings."
Step2: Add a new API key.
Step3: Copy the API key
Step4: Paste it into your code as follows:
xata_api_key = "YourKey"
Setp1: Creat a new database.
Step2: Clink the gear icon and go to the Copy Database URL
Step3: Paste it into your code as follows:
xata_db_url = "YourURL"
./src/ui/tiangong-en.py
export ui=tiangong-en
streamlit run AI.py
Or Using VsCode Debug Streamlit Config
The auto build will be triggered by pushing any tag named like v$version. For instance, push a tag named as v0.0.1 will build a docker image of 0.0.1 version.
#list existing tags
git tag
#creat a new tag
git tag v0.0.1
#push this tag to origin
git push origin v0.0.1
sphinx-apidoc --force -o sphinx/source/ src/
sphinx-autobuild sphinx/source docs/
docker run --detach \
--name tiangong-agent \
--restart=always \
--expose 8501 \
--net=tiangongbridge \
--env ui=tiangong-en \
--env VIRTUAL_HOST=YourURL \
--env VIRTUAL_PORT=8501 \
--env LETSENCRYPT_HOST=YourURL \
--env LETSENCRYPT_EMAIL=YourEmail \
image:tag
For deploying a prototype of this project, we recommend using Streamlit. Streamlit provides an intuitive way to turn data scripts into shareable web applications. If you're unfamiliar with Streamlit or need guidance on deploying your app, refer to their official documentation: Steamlit APP Deploy