Debug Mode & Environment Variables
Opik uses environment variables to configure its behavior. These variables can be set in your shell or in a .env
file.
Debug Mode
To enable debug mode, you can set the following environment variables:
It is important to set these environment variables before you import opik
in your Python scripts.
Using a .env
file
You can also use a .env
file to manage your environment variables. This is a good practice to avoid hardcoding secrets and to make your configuration more portable. You can use the python-dotenv
library to load the variables from the .env
file.
First, install python-dotenv
:
Then, create a .env
file in your project’s root directory with the following content:
Finally, in your Python script, load the environment variables from the .env
file before importing opik
: