Setting up the environment#
We use the environment variables to allow the user to configure the library. The user can set the environment variables in a .env
file in the root directory of the project.
The following environment variables, also specified in the example.env
file, are used:
# OpenAI
ORGANIZATION=""
OPENAI_API_KEY=""
# DATABASES
WDI_DB_TABLE_NAME="wdi"
## POSTRESQL
DB_ENGINE="postgresql"
DB_HOST="localhost"
DB_USERNAME="postgres"
DB_PASSWORD=<your password>
DB_PORT=5432
## SQLITE
# DB_ENGINE="sqlite"
# DB_HOST=
# DB_USERNAME="/data/sqldb/wdi.db"
# DB_PASSWORD=
# DB_PORT=
# VECTOR INDEX
QDRANT_URL="localhost"
QDRANT_PORT=6333
QDRANT_PATH=
# DIRS
LLM4DATA_DIR=~/.llm4data
## Relative to LLM4DATA_DIR
LLM4DATA_CACHE_DIR=cache
OPENAI_PAYLOAD_DIR=openai/payloads
# Task Labels
## Specify the label in the payload directory
## for this prompt set.
TASK_LABEL_WDI_SQL = "prompt2wdiSQL"
# Microdata Catalog URL
## This URL is the default catalog URL for accessing microdata metadata.
CATALOG_URL = "https://microdata.worldbank.org/index.php/api/catalog/"
The example.env
file is updated with the relevant variables used in the project. The user can copy the file and rename it to .env
to set the environment variables. The .env
file is ignored by Git for security reasons so that you can store API keys.
Warning
NEVER commit your .env
file to Git. It is ignored by default in the .gitignore
file, but you should double-check that it is not being tracked by Git.
See the next sections for more details on the environment variables used in the project.